WordPress Website Templates

Find Professional WordPress themes Easy and Simple to Setup

inner banner

Single page – bottom navigation – prior / next limit to category

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
  • #41895
    Lucius Douglas

    How can I limit the navigation on a single page to only go to previous or next articles within the current category of the post?

    Here is a screenshot of a page display 2022 Newsletters:

    As you can see, the previous post is Chaplain – P. L. Wilson MCL, Detachment #447 when we’d like it to display 2021 Newsletters. the next post is 2022 Minutes which we’d like it to display 2023 Newsletters. We don’t want any article to appear in the bottom navigation PREV/NEXT except for those within the category of the current article 2022 Newsletters which is ‘Newsletters’.

    Grace Support

    Sorry , this settings are not available.

    Lucius Douglas

    OK, I know there is no ‘setting’ but can I edit a file to accomplish this? If so, which file and what code?

    Grace Support

    You can change the code to display Prev/next posts

    Go to the Appearance -> Theme Editor -> inc/template-tags.php

    check the code at line no 37 & 38

    <?php previous_post_link( '<div class="nav-previous">%link</div>', '<span class="meta-nav">' . _x( '←', 'Previous post link', 'spangle-pro' ) . '</span> %title' ); ?>
    <?php next_post_link( '<div class="nav-next">%link</div>', '%title <span class="meta-nav">' . _x( '→', 'Next post link', 'spangle-pro' ) . '</span>' ); ?>

    Grace Themes

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.