Home › Forums › Themes Support › Gecko › How to hide a category from Blog
- This topic has 6 replies, 2 voices, and was last updated 7 years ago by anaventura.
-
AuthorPosts
-
-
November 15, 2017 at 5:08 am #13252
I need to hide “featured’ category posts from the blog. (I need them to show up only on a dedicated plugin I installed)
How can I do that?
the blog is under http://www.kaeciconcept.com/blog
and the page where we want the ‘featured’ category posts is
Tks very much!
Ana
-
November 15, 2017 at 5:35 pm #13286
Hi,
Sorry we don’t know how to use the plugin you used. You can ask plugin plugin author they better than us for this case.
You can change menu “name” of page you want to featured blog to “Blog” and hide current “Blog” menu.
and go to Settings > Reading > Change to select to hide default blog layout http://prntscr.com/hapuk1
Best regards
Harry
Premium Wordpress themes and plugins, Best WooCommerce theme https://themeforest.net/user/janstudio/portfolio?ref=janstudio -
November 15, 2017 at 5:49 pm #13290
tks very much Harry! Actually I found a solution that worked . i’ll share here in case others may want the same.
You can edit the functions.php file :
Add this code to the very end of the file before closing php tag ?> and replace 6 with the category ID (that you want to omit from blog):
function exclude_category( $query ) {
if ( $query->is_home() && $query->is_main_query() ) {
$query->set( ‘cat’, ‘-6’ );
}
}
add_action( ‘pre_get_posts’, ‘exclude_category’ );Thank you
Ana
-
November 15, 2017 at 6:01 pm #13294
Hi Ana,
This mean you want exclude a category from your blog page?
We recommend put your customize code in functions.php in gecko-child to keep your code when update parent theme.
Best regards
Harry
Premium Wordpress themes and plugins, Best WooCommerce theme https://themeforest.net/user/janstudio/portfolio?ref=janstudio -
November 15, 2017 at 6:12 pm #13298
Harry, I m so unfamiliar with working with the child theme but I know it’s what i shou;d do yes. For now it works so I’ll do it in a few days.
I do still really need help with
- language menu on mobile (it’s not dropping down – Now its’s not even there)
- and eliminating ‘clients’ for portfolio categories.
I appreciate all the hel you can give me with those 2 items…
-
November 16, 2017 at 12:42 am #13347
Hi Ana,
2 others issues our team member help you solved in another topic. Please reply on correct topic for us easy to track.
Thanks
Harry
Premium Wordpress themes and plugins, Best WooCommerce theme https://themeforest.net/user/janstudio/portfolio?ref=janstudio -
November 16, 2017 at 1:04 am #13348
Will do. Thank you very much for all the support so far.
-
-
AuthorPosts
You must be logged in to reply to this topic.