Jump to content
Sign in to follow this  
steelmayhem

hide category from posts

Recommended Posts

steelmayhem

How do I hide a category from blog posts? Thanks Mark

Share this post


Link to post
Share on other sites
steelmayhem

is this for all? is there a way to hide specified categories? say I have 5 and i dont want one of them.

Share this post


Link to post
Share on other sites
catrina

If you want to one specific category, you can. Just add the category ID for that one category you want to hide (and not any category IDs).


Please read the docs before posting. Please do not private message me unless I ask you to.

Designer | Catrina Dulay

Founder | Catrina and Mouse

Share this post


Link to post
Share on other sites
adonnan
Please correct me if I'm wrong, but I found this code elsewhere and modified it to filter out a couple categories from my blog and rss feed. // Hide Category from feed // function myFeedExcluder($query) { if ($query->is_feed) { $query->set('cat','-28,-312,-196'); } return $query; } add_filter('pre_get_posts','myFeedExcluder'); // Hide Category from blog // function exclude_category($query) { if ( $query->is_home()) { $query->set('cat', '-28,-312,-196'); } return $query; } add_filter('pre_get_posts', 'exclude_category');

Share this post


Link to post
Share on other sites
Jenny
This thread is very old so if you have a question, make sure you start a new discussion. Thanks :)

Jenny :: Web designer at Simple Mama (follow me at @simplemamacom)

Check out Share Me, a social sharing add-on for DMS that is super simple to set up.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

×