The default previous_post_link() and next_post_link() have an option to restrict adjacent posts to the current category. This plugin takes it 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).
You can simply replace previous_post_link() with previous_post_smart() and keep the first two arguments: $format & $title.
If there isn’t a previous post in a set, the normal template tag will be called.
The same goes for next_post_link().
There is also a referrer_link() template tag which displays a link to the referrer. Args:
You can learn more about these by looking at the template-tags.php file.




