[wp-hackers] Excluding a category posts from feed and a little question

mohammad aghanabi m.websoft at gmail.com
Thu Aug 12 09:54:28 UTC 2010

i recently used this short code in functions.php to exclude a category posts
( id=20 ) from being shown in wordpress feed.
function my_cat_exclude($query) {
    if ($query->is_feed) {
    return $query;
but the problem is, this function interrupts other wordpress categories
feeds and they won't show their posts. ( just displaying the main
url feed content )

- for example this feed content : http://www.mysite.com/?feed=rss2&cat=21
is like this content : http://www.websoftdownload.com/?feed=rss2
by using that function and also the plugins that i tested were the same.


More information about the wp-hackers mailing list