Hey Guys – I’d like to be able to exclude some categories from the main blog page – loooong story but I need to exclude it from the single.php, is there a way to do this in the funciotions or the child theme?
Cheers
Hi ShortieD!
Please add following code to Functions.php file in Appearance > Editor
function exclude_category_blog($query) {
if ( $query->is_home() ) {
$query->set('cat', '-33');
}
return $query;
}
add_filter('pre_get_posts', 'exclude_category_blog');
and change 33 with category ID you would like to hide – http://wordpress.org/support/topic/how-to-find-out-category-id-number
Regards,
Yigit