1
2
3
4
5
6
7
8
// Exclude category from home
function myFilter($query) {
    if ($query->is_home) {
        $query->set('category__not_in',array(39,10));
    }
return $query;
}
add_filter('pre_get_posts','myFilter');