• Resolved Joen A.

    (@joen)


    I’ve been using the wonderful cat ="-x"; technique for omitting specific categories from a post loop. It works wonderfully well for omitting my “Sidenotes” category from my main website: http://www.noscope.com/journal/

    It worked as well for omitting specific category posts from my feeds. That is, to my surprise it doesn’t work anymore. For some reason sidenotes are no longer filtered from my feeds, even though the cat ="-21"; is still there.

    Did the code for WordPress feeds change dramatically in version 1.5.1.3? At least, for some reason the cat ="-x"; makes no difference at all in my feed: http://www.noscope.com/feed/

    Any help is appreciated

Viewing 5 replies - 1 through 5 (of 5 total)
  • Not as far as I can tell as I’m relying on the same mechanism. Just so we’re on the same page, I’ll describe what I’m doing.

    In the root index.php, before require('./wp-blog-header.php');, I’m using cat =-x; to exclude category x

    BTW, make sure the value is unquoted i.e. cat =-21 not cat ="-21"

    Thread Starter Joen A.

    (@joen)

    Well, it works for my index.php, the problem is for my feeds, i.e. wp-feed.php, wp-rss2.php etc. In those files it seems to make no difference whatsoever.

    Also, I did use ="-21", but changing it to =-21 made no difference.

    Any ideas?

    Thread Starter Joen A.

    (@joen)

    An update to this.

    I’ve made a fix. It turns out that if I write

    <?php /* FILTER OUT SIDENOTES START */ if ( (21 == $cat) || !(in_category(21)) ) : ?> right before the first <item>, and right after the second <item> of either wp-rss2.php or any of the other feed files, things are dandy.

    The strange thing is, the other technique which is much nicer, used to work just fine. In fact,
    http://www.noscope.com/feed/?&cat=-21
    worked, even though writing $cat=-21 IN the PHP file didn’t.

    I’m smelling a bug here, but hopefully the above posted solution will help out people who have the same problem.

    Thread Starter Joen A.

    (@joen)

    Hmm. That should have been:

    <?php if ( (x == $cat) || !(in_category(x)) ) : ?> (where x is the id of the category to omit) right before the first <item>, and <?php endif; ?>
    right after the second <item> of either wp-rss2.php or any of the other feed files, things are dandy.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Did $cat =”-x” category omission break for feeds in 1.5.1.3?’ is closed to new replies.