RSSから特定のカテゴリーを削除する方法

Ads

Code

<?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');
?>
view raw gistfile1.aw hosted with ❤ by GitHub

Note

Description RSSに配信する記事を、カテゴリ単位で非配信する。
$query->set(‘cat’,’-ID番号,-ID番号’);と書く。
WordPress Ver. 3.3.1
Via Exclude categories from RSS feed with functions.php