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
    Posts
  • #41895
    Lucius Douglas
    Participant

    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:
    https://snipboard.io/rd1Zvu.jpg

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

    #41905
    Grace Support
    Keymaster

    Sorry , this settings are not available.

    #41906
    Lucius Douglas
    Participant

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

    #41917
    Grace Support
    Keymaster

    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>' ); ?>
    

    Regards
    Grace Themes

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