Exclude Category from Blog Homepage

This article is exactly what you need to exclude a category from the blog page.

You just paste in the snippet into your functions.php file and viola.

http://chriswiegman.com/2013/05/excluding-a-category-from-your-wordpress-homepage/

 

// Exclude category from homepage
function my_exclude_category( $query ) {
 
if ( $query->is_home ) {
$query->set( ‘cat’, ‘-230’ );
}
return $query;
}
add_filter( ‘pre_get_posts’, ‘my_exclude_category’ );

Leave a Reply