Thats great – glad we got there – i think thats going to come in very useful 🙂
So for the main post listing you can exclude categories using this function:
function exclude_category( $query ) {
if ( $query->is_home() && $query->is_main_query() ) {
$query->set( 'cat', '-xx' );
}
}
add_action( 'pre_get_posts', 'exclude_category' );
You need to change the xx
to the ID of the Category, you can get the Category ID by editing the Category and looking in the URL it will say ID=66
or something.
Make sure you keep the -
minus. So if the ID is 66
this line will be:
$query->set( 'cat', '-66' );