Skip to content
Public Ticket #32275

Filter previous / next post navigation by category and tag

Conversation thread

PenciDesign Supporter replied

Staff Reply

Hi,

Unfortunately, there is no hook, filter, or option available for customization in the current version of Soledad/WordPress. If you would like to modify it, you will need to copy the parent theme file to the child theme (if your site is using a child theme).

wp-content/themes/soledad/inc/templates/post_pagination.php

To:

wp-content/themes/soledad-child/inc/templates/post_pagination.php

Regards,
PenciDesign.

Jeroen Kleiberg started the conversation

Conversation Start

Hello,

On single post pages, the theme currently shows a “Previous article” and “Next article” navigation.
At the moment, these links only follow the general post order.

I would like to add a setting (or customization) so that this navigation only links to posts that:

  1. Belong to the same category, and

  2. Share at least one identical tag with the current post.

Reason:
Some posts are part of a chronological or narrative series (using a shared tag), while other posts in the same category provide background or contextual information. I want the previous/next navigation to respect the logical order of the series, without jumping to related-but-out-of-sequence background articles.

Ideal behaviour:

  • Previous / Next posts are selected only from posts that match both category and tag.

  • If no matching post exists, the navigation can either be hidden or fall back to category-only (optional).

Could you let me know:

  • If this is already possible via theme settings or hooks?

  • Or which template / function controls this navigation, so it can be customised?

Thanks in advance.

Want to join this conversation or access attachments? Sign in first.