Created
December 17, 2015 08:14
-
-
Save pixelloop/997706607939d2e5fe22 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Exclude specific categories from home | |
add_action( 'pre_get_posts', 'bg_exclude_categories' ); | |
function bg_exclude_categories( $query ) { | |
if( $query->is_main_query() && $query->is_home() ) { | |
$query->set( 'cat', '-5,-9' ); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment