Created
December 9, 2015 12:18
-
-
Save leanda/d182c36f44fc65e9cb24 to your computer and use it in GitHub Desktop.
Excludes chosen category from home (functions.php)
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
/** | |
* Excludes chosen project category from home | |
*/ | |
function excludeCat($query) { | |
if ( $query->is_home ) { | |
$query->set('cat', '-198'); | |
} | |
return $query; | |
} | |
add_filter('pre_get_posts', 'excludeCat'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment