Home › Forums › Support › Hide Category from sidebar menu This topic has 5 replies, 3 voices, and was last updated 4 years, 5 months ago by Leo. Viewing 6 posts - 1 through 6 (of 6 total) Author Posts December 14, 2018 at 4:14 pm #757086 Gevorg Hello, I am trying to hide one category from displaying in the drop-down menu on the sidebar. I looked at some previous discussions here and added the following code add_filter(‘pre_get_posts’, ‘excludeCat’); function excludeCat($query) { if ( $query->is_home ) { $query->set(‘cat’, ’69’); } return $query; } But it gives some errors and not saving in the custom CSS. Could you please guide? Thank you December 14, 2018 at 5:04 pm #757104 LeoStaff Customer Support Hi there, The code you have would exclude a certain category from the blog archive page. The category widget is coming from WordPress and not controlled by GP. I did find this that might be worth trying: https://wordpress.stackexchange.com/a/253170 The code would be PHP. Let me know if this helps 🙂 December 14, 2018 at 7:42 pm #757164 Gevorg Hi Leo, I tried it but it still gives an error. December 14, 2018 at 8:04 pm #757173 TomLead Developer Lead Developer Make sure you’re adding it using one of these methods, as it’s not CSS: https://docs.generatepress.com/article/adding-php/ December 14, 2018 at 8:14 pm #757175 Gevorg Ok, I figured it. Thank you again for your support! December 14, 2018 at 8:20 pm #757177 LeoStaff Customer Support Glad we could help! Author Posts Viewing 6 posts - 1 through 6 (of 6 total) You must be logged in to reply to this topic. Log In Username: Password: Keep me signed in Log In