Plugin Directory

Smarter Navigation

Author: scribu

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).

Template tags

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:

  • $format = '%link'
  • $title = '%title'
  • $sep = '»'
  • $seplocation = 'left'

You can learn more about these by looking at the template-tags.php file.

Download

FYI

Compatibility beta

Your Setup

Log in to vote.

The Consensus (1 reporting)

100%
100,1,1
100,1,1

Average Rating

5 stars
4 stars
3 stars
2 stars
1 star
(3 ratings)