Wordpress Themes - WP Forum at BFA
Click Here To DONATE! Support the theme development, get more attention and additional benefits based on your donation level. Your forum name will be highlighted.

Wordpress Themes - WP Forum at BFA » WordPress Themes » Atahualpa 3 Wordpress theme » Center area post/pages »

Different background color on every second post?

Build custom WP THEMES, without
Click here for THEMEFRAME

From the author of Atahualpa, the #1 most
downloaded (700,000+) theme @ wordpress.org
Old May 10, 2010, 06:56 AM
21 posts · Mar 2009
Help Different background color on every second post?


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?

Old May 10, 2010, 03:18 PM
21 posts · Mar 2009
I found the thread about it here:

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: ...


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:25 AM.

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