The default previous_post_link() and next_post_link() have an option to restrict adjacent posts to the current category. This plugin takes one step further:

If you visit an archive page (category, tag, date, author, search etc.) and then visit a single post from that page, the previous_post_smart() and next_post_smart() will point only to the other posts in that archive page.

This is particularly useful for photoblogs (that’s where I use it).

If there isn’t an adjacent post, it will use the normal template tags.

Comments (6)

  • Miquel says:

    Hi, thanks for this pluguin. I only have one question. In each archive/category page I use a paging navigation (WP-PageNavi), with 5 posts per page. When you get to the last post in a page, then the next-prev links stops and you have to go back to change the referrer page you were in. Is there a way to keep the links showing regardless of the pagination ? Thanks again

  • Miquel says:

    I’m sorry, our site is off-line.
    Here you can see a pagination example: http://www.johntp.com/category/wordpress/

    What I wanted to achieve is browsing ‘post to post’ (with your pluguin) from the first to the last post in a category, regardless of the pagination. Now you can browse ‘post to post’ until the end of the page you come from (page/1, page/2, etc). I hope this makes sense now…
    Thanks again

    • scribu says:

      Yes, now I get what you’re saying. This is definetly something worth fixing. I’ll see what I can do.

  • Jon Maduro says:

    This is an Awesome plugin! Is there any way I can show the title as ‘Previous’ instead of the actual title? As well with Next.

    Thank you for the Plugin!