• Greetings!

    I’m trying to make the “next post” & “prev post” links only link to posts in the same sub-category as the displayed post. (which seems like a pretty normal use case to me).

    I’ve searched the web all day, and so far the only thing I’ve found is about a ka-jillion requests for this feature but no plug-in or hacks.

    Anyone know of a solution ? Surprised that there isn’t a plugin for this already, as it seems like a normal thing to do.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Moderator bcworkz

    (@bcworkz)

    WP has several navigation template tags, none of them do what you wish ?? Depending on which ones your theme uses and where, you may be able to hook a filter and change the next and previous links. Because these tags usually run a query to determine the links, you may actually be better off writing some custom functions to call instead of what your theme uses, preventing needless queries. Naturally you would need to alter all related templates to do so. This would not be that big a problem for your own site, but it’s a problem for plugin developers, which could partly explain your inability to find one.

    Your custom function would basically work like the ones it replaces, except for the additional query restriction to the current category or taxonomy term.

    Thread Starter Phil Emery

    (@noise)

    thanks – every now and then one slams into WordPress’s blog origins. In some way it’s still not quite a full fledged CMS.

    People use categories and tags very differently, so they really should put this category behaviour in core (especially as more browse on tablets which encourages more “page flipping” behaviour in users.)

    I might try to write a commercial plug in for this – considering the pages of google results with people wanting this fix – it could be very lucrative !

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘prev/next post links only in same Sub-category’ is closed to new replies.