• Hello all! I am having issues with my category pages.

    When I use just the loop in the category:

    <?php while (have_posts()) : the_post(); ?>

    only the posts in the current category are displayed. I don’t have many posts yet, but I want to ensure that only a few posts are displayed at a time. However, if I use “query posts” before the loop:

    <?php query_posts('posts_per_page=6'); ?>
        <?php while (have_posts()) : the_post(); ?>

    the current category page displays ALL posts, instead of just the posts within the current category. What am I doing wrong here? What is the correct way to display a limited number of posts within the current category?

    I have Googled this extensively and without luck. For reference, my blog is https://melanie-richards.com/blog, and I am using a customized version of Sandbox (so, their functions.php file).

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Query posts [incorrectly] displays all posts on category pages’ is closed to new replies.