Wordpress Themes - WP Forum at BFA

Wordpress Themes - WP Forum at BFA (http://forum.bytesforall.com/index.php)
-   Atahualpa 3 Wordpress theme (http://forum.bytesforall.com/forumdisplay.php?f=2)
-   -   [SOLVED] using php in CSS inserts (http://forum.bytesforall.com/showthread.php?t=14014)

tunturiflyer May 3, 2011 04:02 PM

[SOLVED] using php in CSS inserts
since this took me longer than a monkey on a typewrite to work out, I thought I would post this. I wanted to have a different color background for posts (green) and pages (white). (don't ask why).

Setting every page and post backgroud green is in Style and Edit Center Column/Center column Style, then add background: green;

this seems to work (atahualpa 3.5.3, because my ISP doesn't run current versions of php.)

this bit of php goes in ATO/add HTML/CSS inserts/CSS inserts.

<?php if (is_page()) {?> td#middle {background: white} <?php }

i.e, <?php turn on php, run if () statement, with wordpress is_page() function, then if true {execute a block of code, ?> turn off php, and set CSS style for td#middle {background: white} turn on php, finish block of code } (which doesn't have a semi-colon after it) and turn off php ?>

I discovered it was td#middle by changing the colours, and looking for what changed in the view source, in the <style="text/css"> section, which needed configure CSS &JS/CSS to be set to inline.

I suspect there are better ways of achieving this.

lmilesw May 3, 2011 04:21 PM

You perhaps could use the following in ATO>Add HTML/CSS Inserts>CSS Inserts
HTML Code:

.type-page {
background: #fff !important;
.type-post {
background: #greenhexcode !important;

tunturiflyer May 3, 2011 05:45 PM

Aha, I would guess an even better soln. appreciated.

All times are GMT -6. The time now is 09:21 AM.

Powered by vBulletin® Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.