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
coding.
Click here for THEMEFRAME

From the author of Atahualpa, the #1 most
downloaded (700,000+) theme @ wordpress.org
  #1  
Old May 10, 2010, 06:56 AM
conon
 
21 posts · Mar 2009
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 12:16 PM.


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