Madcore
Member
Posted 5 years ago #
Hi all.
I want to exclude some categories of my blog from appear on the feeds of the blog, and on the archives. The reason is simple. I´m using some categories of posts to make an faq section, and links section (instead of internal link system), things that doesn´t catch good into feeds and archives.
There´s any plugin or method to exclude those categories from the feeds and from the archives?
Thanks for your time :3.
The only way I know of is to change the feed links to ?feed=rss2&cat=3,4,6 and change the category numbers to the ones you want to include. All other categories would be excluded.
To exclude a category from my feed, I have a snippet like this in my theme's functions.php file:
<?php
function myFilter($query) {
if ($query->is_feed) {
$query->set('cat','-19');
}
return $query;
}
add_filter('pre_get_posts','myFilter');
?>
Category 19 is the one I don't want in the feed.
This plugin does all of that:
http://ryowebsite.com/?p=46
Ahh... I'd never noticed that plugin handled RSS too.
Thanks for that.
Madcore
Member
Posted 5 years ago #
Thanks you very much, people ^_^!!
I got the plugin, and the snipet (I like work with code), and it works.
YOU´RE NUMBER ONE