Hello there,
I’m trying to exclude 2 categories from the home page.
I have already made the theme-child.
I put on the function.php this code:
// Escludere categorie da home
function exclude_category($query) {
if ( $query->is_home() ) {
$query->set(‘category__not_in’, ‘3’, ‘5’);
}
return $query;
}
add_filter(‘pre_get_posts’, ‘exclude_category’);
But it doesn’t work.
Thank you for your kind support