Advertisement
Guest User

Even / odd class

a guest
Mar 12th, 2012
455
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. <?php query_posts('posts_per_page=6'); ?>
  2. <?php while (have_posts()) : the_post(); ?>
  3. <div id="blog-entry" <?php
  4. $postcount++;
  5. if( ($postcount % 2) == 0 ) :
  6. echo " class=\"even\"";
  7. elseif ( ($postcount % 2) != 0 ):
  8. echo " class=\"odd\"";
  9. ?>>
  10. <div <?php post_class() ?> id="post-<?php the_ID(); ?>">
  11. ~ posts go here ~
  12. </div>
  13. </div>
  14. <?php endif; ?>
  15. <?php endwhile; ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement