Wordpress Themes - WP Forum at BFA
There will be no more development for Atahualpa (or any other theme), and no support. Also no new registrations. I turned off the donation system. I may turn the forum to read only if it gets abused for spam. Unfortunately I have no time for the forum or the themes. Thanks a lot to the people who helped in all these years, especially Larry and of course: Paul. Take care and stay healthy -- Flynn, Atahualpa developer, Sep 2021

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 03:44 PM.


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