Site logo

Archived topic

How can I disconnect certain post category from the post navigation?

8 replies · Started by jisu on October 13, 2022

Viewing posts 1–9 of 9

Hello,

Recently I figured out how to hide the post category from my blog page, but When I write a post, the post navigation shows my hidden category blog post. How can I disconnect the hidden category from the post navigation?

Thanks

I have another problem.
I only see hidden category post in every issued post's post navigation.

I fixed this problem by editing snippet code, but i still can't exclude hidden blog category from post navigation. I have tried the code that you provide from previous forum but nothing happen. Please take a look at the link i left on reply.

thanks,

So this is the code to remove Posts of a specific Category from the post nav:


add_filter( 'get_next_post_excluded_terms', 'tu_exclude_terms' );
add_filter( 'get_previous_post_excluded_terms', 'tu_exclude_terms' );
function tu_exclude_terms() {
    return array( 10, 15 );
}

the 10 and 15 are the Category Term IDs. you need to swap them to the category(ies) you want to exclude.

If thats not working, please share a post to where i can see the problem.

David,

I found out the id. Problem resolved. Thanks

Glad to hear that!!

This archived topic is closed to new replies.