I found this code on this site by AshFrame which I added to my functions PHP file and works perfectly to stop one category being displayed on my blog (I have a custom menu so have the category displayed separately)…
add_action('pre_get_posts', 'block_cat_query' );
function block_cat_query() {
global $wp_query;
if( is_home() ) {
$wp_query->query_vars['cat'] = '-98';
}
}
My question is how do I format this code to include a second category (in my case -92)? I tried duplicating the code but it generates a PHP error because you can only run the function once I think.
cat takes a comma deliminated list, so ‘-98,-92’
Further reading http://codex.wordpress.org/Class_Reference/WP_Query#Category_Parameters