• Hey people!

    I’ve got two loops in my index.php

    <?php $my_query = new WP_Query('tag=featured'); ?>
      <?php if( $my_query->have_posts() ) : while( $my_query->have_posts() ) : $my_query->the_post(); ?>
        <?php get_template_part( 'content', get_post_format() ); ?>
      <?php endwhile; endif; ?>
    <?php if( have_posts() ) : while( have_posts() ) : the_post(); ?>
      <?php if( ! has_tag( 'featured', get_the_ID() ) ) : ?>
        <?php get_template_part( 'content', get_post_format() ); ?>
      <?php endif; ?>
    <?php endwhile; endif; ?>

    In WP settings I have set to display 5 post on each page. But it displays only 4 (four) posts!!! <– this is related to the second loop (the first loop is OK)

    I’ve tried to put the following functions between the loops, but it also do nothing!

    wp_reset_query();
    wp_reset_postdata();
    rewind_posts();

    Anyone faced this issue? Any help will be very much appreciated ??

    === EDIT

    I’ve also noticed – on each older page, it shows me one post less. So if I set 7 post per page, it displays 6 on the homepage, 5 on the paged=2, 4 on the paged=3 etc. ;/

  • The topic ‘Multiple Loops issue, not showing proper posts per page’ is closed to new replies.