I came across a strange problem while working on my dev environment for a site we're making. We have custom post types, so I'm not sure if that's the reason why it's not working correctly. However, I managed to get the posts to display 5 at a time instead of normal 10. However, in one of the categories, it only displays 10 out of 20 posts. What's weird is that if I go to a different category, it'll run correctly.
<?php echo category_description(); ?> <?php if (have_posts()) : ?> <?php $i = 0; while (have_posts() && $i < 5) : the_post(); ?> <div class = "post"> <h3 class="listing-<?php the_ID(); ?>"> <br> <a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"> <?php the_title(); ?> </a> </h3> </br> <div class = "city"> <b> City:</b> <?php $City = get_post_meta($post->ID, 'City', true); echo $City;?> </div> <div class = "price"> <b> Price:</b> <?php $Price = get_post_meta($post->ID, 'Price', true); echo $Price;?> </div> <b>Rating:</b> <div class = "rating"> <?php wp_gdsr_render_article(); ?> </div> </div> <br> </br> <?php $i++; endwhile; ?> <div class="navigation"> <div class="alignleft"> <?php previous_posts_link(); ?> <?php next_posts_link(); ?> </div>
Answer: Thanks for the help everyone!
The way to get around it is to go to:
WP Dashboard > Settings > Reading and change the number at "blog pages show at most" option to the number of pages to display.