posts_per_page is giving unreliable results
-
I keep getting a different number of post_per_page from this loop.
Sometimes 1 and sometimes 2. If I change it to post_per_page=3 I sometimes get 2 and sometimes 3 – you get the idea? I don’t get it, any ideas anyone?
https://pastebin.com/nTRcEmvUI have one other loop running before the unreliable one which is below:
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<?php $do_not_duplicate = $post->ID; ?>
<?php the_content(); ?>
<?php endwhile; ?>
<?php endif; ?>and another one after it (below):
<?php $sidebar = new WP_Query(‘post_type=sidebar’); ?>
<?php while ($sidebar->have_posts()) : $sidebar->the_post(); ?>
<?php the_content(); ?>
<?php endwhile; ?>I don’t see why the two other loops would be messing with the unreliable one… any ideas?
Thanks
Dan
- The topic ‘posts_per_page is giving unreliable results’ is closed to new replies.