Created
January 16, 2013 06:03
-
-
Save xhinking/4545012 to your computer and use it in GitHub Desktop.
Give WordPress Posts An Even-Odd Class. via -> http://gregrickaby.com/2012/05/wordpress-posts-even-odd-class.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php if (have_posts()) : while (have_posts()) : the_post();?> | |
<div id="post-<?php the_ID(); ?>" <?php $even_odd = (++$j % 2 == 0) ? 'even-post' : 'odd-post'; post_class( $even_odd ); ?> | |
<p><?php the_excerpt(); ?><> | |
</div> | |
<?php endwhile; endif; ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment