Home › Forums › Support › Hide posts that belong to a certain category from the post navigation links This topic has 2 replies, 2 voices, and was last updated 3 years, 2 months ago by Leo. Viewing 3 posts - 1 through 3 (of 3 total) Author Posts February 23, 2021 at 4:25 pm #1669937 George I am currently hiding posts that belong to a certain category from the blog page by using the following code: add_filter('pre_get_posts', 'excludeCat'); function excludeCat($query) { if ( $query->is_home ) { $query->set('cat', '-45'); } return $query; } Is there a way to add to the query to also hide the posts from the post navigation links so that they don’t get displayed either? February 23, 2021 at 4:53 pm #1669952 George I think I found the solution in Tom’s post here: https://generatepress.com/forums/topic/post-navigation-how-exclude-a-category-from-next-and-previous-post-links/#post-481862 February 23, 2021 at 5:41 pm #1669987 LeoStaff Customer Support Glad to hear 🙂 Author Posts Viewing 3 posts - 1 through 3 (of 3 total) You must be logged in to reply to this topic. Log In Username: Password: Keep me signed in Log In