Created
December 2, 2020 19:09
-
-
Save bkno/3d8c9bf9a2b71218c2f8c70085abbe26 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
function exclude_category($query) { | |
if ( $query->is_feed ) { | |
$query->set('cat', '-999'); // replace 999 with your category ID | |
} | |
return $query; | |
} | |
add_filter('pre_get_posts', 'exclude_category'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment