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 » Post-Kicker, -Byline & -Footer »

[SOLVED] Alternating color for post on homepage


  #1  
Old Jun 11, 2009, 02:23 PM
viscouse
 
5 posts · Jun 2009
I know there is an option for making every other comment different colors.

I couldn't find a similar option for posts. Does it exist and I missed it?

If not is there a way to impliment that?

Thanks!
  #2  
Old Jun 24, 2009, 06:18 PM
viscouse
 
5 posts · Jun 2009
Sorry to bump this, but would anyone know how to do this?
Should I make this a feature request?
  #3  
Old Jun 25, 2009, 10:35 AM
Flynn's Avatar
Flynn
 
3,768 posts · Oct 2008
Munich, Germany
You can edit index.php

<?php // Post Container starts here
if ( function_exists('post_class') ) { ?>
<div <?php if ( is_page() ) { post_class('post'); } else { post_class(); } ?> id="post-<?php the_ID(); ?>">
<?php } else { ?>
<div class="<?php echo ( is_page() ? 'page ' : '' ) . 'post" id="post-'; the_ID(); ?>">
<?php } ?>


Change to


<?php // Odd or even
$odd_or_even = (($postcount % 2) ? 'odd-post' : 'even-post' ); ?>


<?php // Post Container starts here
if ( function_exists('post_class') ) { ?>
<div <?php if ( is_page() ) { post_class('post'); } else { post_class("$odd_or_even"); } ?> id="post-<?php the_ID(); ?>">
<?php } else { ?>
<div class="<?php echo ( is_page() ? 'page ' : '' ) . 'post" id="post-'; the_ID(); ?>">
<?php } ?>


I included the code above in 3.3.4


Add a CSS Insert:

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

div.even-post {
background: ...
border: ...
}
  #4  
Old Jun 25, 2009, 07:08 PM
viscouse
 
5 posts · Jun 2009
Thank you Flynn!

I appreciate your responsiveness!

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to modify the links below each post on the homepage ? ( Date, tags , Leave a com. 3ukman Header configuration & styling 5 Jul 10, 2009 11:05 AM
set a different background color for homepage only? hiccupgirl Atahualpa 3 Wordpress theme 2 Jul 3, 2009 06:11 PM
how do i get comments to show up on homepage for each post??? drewjones Comments, trackbacks & pings 2 Apr 15, 2009 07:04 PM
Post PHP on one page only, and not homepage blueprairie Plugins & Atahualpa 2 Apr 2, 2009 07:28 AM
Post headers on homepage - Link to pages instead? ray-zin Atahualpa 3 Wordpress theme 4 Mar 11, 2009 03:45 PM


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


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