Wrong Number of Posts per Page
-
Hey guys,
So the code is:
<?php query_posts('post_type=post&post_status=publish&posts_per_page=3&paged='. get_query_var('paged')); ?> <?php if( have_posts() ): ?> <?php while( have_posts() ): the_post(); ?> <?php if( in_category( array('Performances')) ): ?> //do something <?php endif; ?> <?php endwhile; ?> <?php endif; wp_reset_query(); ?>
So up at the top I’ve told it to show 3 posts per page. I’ve also told it to only show posts that are categorized as “Performances.” The problem is, it’s counting the posts that it’s not showing, so for example: Let’s say I have six posts all except the two most recent are categorized as “Performances.” What I’m getting is one post on page one, because it’s counting the two posts in other categories, and then a full page two with the rest.
How can I get it to only show posts categorized as “Performances,” and also display three posts per page?
Thanks!
Also, I’m pretty new to PHP and WordPress so please be very complete…
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Wrong Number of Posts per Page’ is closed to new replies.