Wordpress Themes - WP Forum at BFA

Wordpress Themes - WP Forum at BFA (http://forum.bytesforall.com/index.php)
-   Center area post/pages (http://forum.bytesforall.com/forumdisplay.php?f=32)
-   -   Different background color on every second post? (http://forum.bytesforall.com/showthread.php?t=7047)

conon May 10, 2010 06:56 AM

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

conon May 10, 2010 03:18 PM

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



All times are GMT -6. The time now is 03:59 PM.

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