Code
This file contains hidden or 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
<?php | |
function exclude_cat_wps($query) { | |
if ($query->is_feed) { | |
$query->set('cat','-5,-10,-102'); | |
} | |
return $query; | |
} | |
add_filter('pre_get_posts','exclude_cat_wps'); | |
?> |
Note
Description | RSSに配信する記事を、カテゴリ単位で非配信する。 $query->set(‘cat’,’-ID番号,-ID番号’);と書く。 |
---|---|
WordPress Ver. | 3.3.1 |
Via | Exclude categories from RSS feed with functions.php |