steelmayhem 1 Report post Posted June 16, 2011 How do I hide a category from blog posts? Thanks Mark Share this post Link to post Share on other sites
cmunns 16 Report post Posted June 16, 2011 http://codex.wordpress.org/Function_Reference/query_posts#Exclude_Categories_From_Your_Home_Page You could add this code using a filter hook in the functions.php file of your child theme. hook location : pagelines_before_theloop Share this post Link to post Share on other sites
steelmayhem 1 Report post Posted June 16, 2011 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 103 Report post Posted June 17, 2011 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 1 Report post Posted January 23, 2012 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 33 Report post Posted January 23, 2012 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