Forums

Every second post only (3 posts)

  1. theinquisition
    Member
    Posted 2 years ago #

    This should be simple :)
    I have a front page that displays the xxx number of most recent posts. How can I exclude every even number post? That way with each single new post it would appear that the entire site had changed.

  2. esmi
    Theme Diva & Forum Moderator
    Posted 2 years ago #

    Try something like:

    <?php $my_count=0;
    if (have_posts()) :  while (have_posts()) :
    $my_count++;
    if( $my_count % 2 ) == 0 continue;
    the_post(); ?>
  3. theinquisition
    Member
    Posted 2 years ago #

    That was quick! Thanks

Topic Closed

This topic has been closed to new replies.

About this Topic