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 » Center area post/pages »

Different background color on every second post?


  #1  
Old May 10, 2010, 06:56 AM
conon
 
21 posts · Mar 2009
Help Different background color on every second post?

Hi,

I can't figure out how I can have different background color on every second post. I understand that it should be something that I do in the center column loop. The first posts should be white, the second yellow, the third white and so on...

Someone that have any advices?

Best,
Sebastian
  #2  
Old May 10, 2010, 03:18 PM
conon
 
21 posts · Mar 2009
I found the thread about it here:
http://forum.bytesforall.com/showthread.php?t=2013

But it didn't work with the code that could be found in index.php. It started working when I put this code in the loop:

PHP Code:
<?php /* Add Odd or Even post class so post containers can get alternating CSS style (optional) */
        
$odd_or_even = (($bfa_ata['postcount'] % 2) ? 'odd-post' 'even-post' ); ?>
and then add CSS Insert:

HTML Code:
div.odd-post {
background: ...
border: ...
}

div.even-post {
background: ...
border: ...
}

Bookmarks

Tags
background, center, column, loop, post

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Transparent background PNG WITH background color? interage Header configuration & styling 2 Nov 16, 2009 12:59 PM
[SOLVED] Different title color and byline background color for different categories? chiara7 Post-Kicker, -Byline & -Footer 1 Sep 9, 2009 06:01 PM
[SOLVED] How to change Post Content (Body) background color darmanpurba@gmail.com Forum How-To 6 Aug 10, 2009 05:34 AM
[SOLVED] How to get a background image show thru background color juggledad Header configuration & styling 3 Apr 18, 2009 05:03 AM
Fixed width site. Different page background color from body color? blueprairie Forum How-To 1 Mar 20, 2009 08:55 PM


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


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