Wordpress Themes - WP Forum at BFA
There will be no more development for Atahualpa (or any other theme), and no support. Also no new registrations. I turned off the donation system. I may turn the forum to read only if it gets abused for spam. Unfortunately I have no time for the forum or the themes. Thanks a lot to the people who helped in all these years, especially Larry and of course: Paul. Take care and stay healthy -- Flynn, Atahualpa developer, Sep 2021

Wordpress Themes - WP Forum at BFA » WordPress Themes » Atahualpa 3 Wordpress theme »

[SOLVED] using php in CSS inserts


  #1  
Old May 3, 2011, 03:02 PM
tunturiflyer
 
5 posts · Apr 2011
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.
  #2  
Old May 3, 2011, 03:21 PM
lmilesw's Avatar
lmilesw
 
10,176 posts · Jul 2009
Central New York State USA
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;
}
__________________
~Larry (CNY Web Designs)
This site should be a membership site since it so full of good stuff.
Please consider donating which gives you access to even more good stuff.
  #3  
Old May 3, 2011, 04:45 PM
tunturiflyer
 
5 posts · Apr 2011
Aha, I would guess an even better soln. appreciated.

Bookmarks

Tags
css inserts

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
PHP include in CSS Inserts sawyerjw Atahualpa 3 Wordpress theme 10 Apr 8, 2011 02:41 PM
[SOLVED] 3.5.3 Default text in ATO&gt;Add HTML/CSS Inserts&gt;CSS Inserts boris_mcnorris New Versions, & Updating 4 Oct 16, 2010 03:57 PM
[SOLVED] PHP code in HTML / CSS Inserts. MickR Header configuration & styling 2 Aug 12, 2010 02:47 PM
ADD HTML/CSS Inserts -- 3.5.1 --- Need to remove default CSS Inserts ortho New Versions, & Updating 0 Jun 23, 2010 03:17 PM
[SOLVED] why Fields in the Atahualpa 3.3.3 does not expand? css inserts, html inserts ppat2 New Versions, & Updating 3 Jun 2, 2009 05:41 PM


All times are GMT -6. The time now is 02:37 PM.


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