[SOLVED] Alternating color for post on homepage
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! |
Sorry to bump this, but would anyone know how to do this?
Should I make this a feature request? |
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: ... } |
Thank you Flynn!
I appreciate your responsiveness! |
All times are GMT -6. The time now is 04:47 AM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.