Alternating Displayed Entry Classes
-
I’ve got this simple bit of code, that displays 10 entries. I want each div to have an alternating class (alt class for alternating rows). It also bypassed the 3 most recent posts. What’s the best way to achieve this? Thanks in advance!
<?php
$posts_query = new WP_Query(‘showposts=10&order=DESC’);while( $posts_query->have_posts() && ($post_count < 15) ) : $posts_query->the_post();
$post_count++;
if ($post_count<4)
continue; ?><div class=”archive alt<!– Need This To Alternate –>”>
<h4>” rel=”bookmark” title=”<?php the_title(); ?>”><?php the_title(); ?></h4><p><?php the_author_posts_link(); ?> | <?php comments_popup_link(‘Leave a Comment’, ‘1 Comment’, ‘% Comments’); ?>
</p></div>
<?php endwhile; ?>
- The topic ‘Alternating Displayed Entry Classes’ is closed to new replies.