Twenty Ten
How to filter posts for a specific category (3 posts)

  1. pjgregory
    Posted 4 years ago #

    I have my posts organized by category. If I click on a category, I see a summary of all the posts sorted in descending date order. Fine so far.

    If I then click on "Continue Reading", I see the full content of the post. However the "Previous" and "Next" links at the top and bottom of the page are no longer filtered to show only the posts in the category. Instead, they show the previous or next post in date order, irrespective of category.

    This makes it difficult to read a chronological series of posts in a specific category without returning to the category summary page each time. Is there a parameter I need to set in the dashboard or a fix that will make this theme work in the way I expect.

    Paul Gregory


  2. aliceralph
    Posted 4 years ago #

    Could you try filtering the next/last links by 'in_same_cat'?

    For example see: http://codex.wordpress.org/Function_Reference/next_post_link#Usage

    <?php next_post_link('in_same_cat'); ?>

    Haven't tested this so not sure if it would work correctly but hopefully barking up the right tree.

  3. kikib
    Posted 3 years ago #

    I did what you suggested. but it didn't work. Which file should i put it in? loop.php, functions.php, etc?

Topic Closed

This topic has been closed to new replies.

About this Theme

About this Topic