• Resolved marbleoscar

    (@marbleoscar)


    I’m trying to exclude a specific category from post navigation. I have the category ID, and this question-and-answer seems to generally answer my question, but I can’t understand how and where I need to apply that within gridmag. What I see in the post-navigation.php file is wp_pagenavi, which I’m assuming is a bit different from what they’re talking about in that link.

    Please help.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Theme Author themesdna

    (@themesdna)

    Thread Starter marbleoscar

    (@marbleoscar)

    I have tried that plugin, yes. It works for excluding the category the from home page for example, but it does not fix navigation to stop displaying posts with that category.

    Thread Starter marbleoscar

    (@marbleoscar)

    To more thoroughly explain what I’m looking for, let’s say I have two categories: ‘Blog Post’ and ‘Off Topic’. When users see the “next post” and “previous post” options under the posts categorized as ‘Blog Post’, I don’t want them to see posts categorized as ‘Off Topic’. It’s fine if the Off Topic posts have no navigation under them whatsoever. I just want navigation on the main posts to completely ignore that the ‘Off Topic’ category exists, skipping over to the next ‘Blog Post’ instead.

    Theme Author themesdna

    (@themesdna)

    Hi, You will need a custom code to exclude posts(from a specific category) from post navigation like that. Thanks.

    Thread Starter marbleoscar

    (@marbleoscar)

    For anyone viewing this in the future, you just need to add the argument $excluded_terms => 'YourCategoryID' to the_post_navigation, where YourCategoryID is the ID of the category you want to be omitted from pagination.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Exclude category from post navigation’ is closed to new replies.