• Hi,

    I’m wondering if it’s possible to have a next_post_link and previous_post_link that navigates through posts only within the current category and the current post format. I have a ‘photoshoots’ post format with two categories, ‘weddings’ and ‘portraits’ within it, which are also shared with standard blog posts. If someone clicks on a photoshoot post, I would like the next and previous post links to only show photoshoots within the current category.

    Is this possible? Searching hasn’t turned up any useful leads for once but I wonder if I’m searching for the wrong thing!

Viewing 3 replies - 1 through 3 (of 3 total)
  • This article describes a way to stay in category when a posts are assigned multiple categories. It involves modifying several templates to accept a URL argument specifying the category. A similar approach could be used to pass the post format.

    Thread Starter Emma_W

    (@emma_w)

    I can’t figure out how to get the above to work with multiple taxonomy types (the first conversation thread in the comments suggests that this isn’t doable with this method anyway). Each post is only in one category, but I can’t figure out how to *only* move within posts *of a particular format*. I still haven’t found an alternative solution to try. Hmm.

    The article shows how to pass an argument for a category. You must use a similar technique to that shown in the article to pass the ‘particular format’ that you want to navigate within.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘next_post_link within current category *and* current post format?’ is closed to new replies.