Wordpress Themes - WP Forum at BFA
Click here to register or to donate.
Auto self-registration is not available here - far too many spammers. This forum has many, many backlinks and because of that there is an intense desire among spammers to drop their links here.

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

Different background color on every second post?

Old May 10, 2010, 07:56 AM
21 posts · Mar 2009

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, 04: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 01:59 PM
[SOLVED] Different title color and byline background color for different categories? chiara7 Post-Kicker, -Byline & -Footer 1 Sep 9, 2009 07:01 PM
[SOLVED] How to change Post Content (Body) background color darmanpurba@gmail.com Forum How-To 6 Aug 10, 2009 06:34 AM
[SOLVED] How to get a background image show thru background color juggledad Header configuration & styling 3 Apr 18, 2009 06:03 AM
Fixed width site. Different page background color from body color? blueprairie Forum How-To 1 Mar 20, 2009 09:55 PM

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

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