Code to hide category feeds
-
My site is indianexaminer.com. In the upper left, there’s a link: “Stay Connected > Latest Posts in RSS (menue opens up with all the category feeds”. I would like to exclude certain feeds from showing up there.
I’ve tried using the following code in my functions.php but it just messes everything up in that file and the site goes down.function my_cat_exclude($query) {
if ($query->is_feed) {
$query->set(‘cat’,’-ID1,-ID2,-ID3′);
}
return $query;
}add_filter(‘pre_get_posts’,’my_cat_exclude’);
I also tried using Advance Category Excluder but it does not work!
I’m guessing using the right code in the right php file (header.php or functions.php ?) I can get it done. I can post the needed php files, if you need more insight.
Thank you.
The topic ‘Code to hide category feeds’ is closed to new replies.