WordPress.org

Ready to get started?Download WordPress

Forums

Feed filter broke in 3.1 (2 posts)

  1. amandabee
    Member
    Posted 3 years ago #

    I'm piping tweets onto my blog with Twitter Tools, but I don't want my tweets in my RSS feed. They're all in one category with id 18, and this (in functions.php) was working fine to keep them out:

    function filterFeed($query) {
        if ($query->is_feed) {
             $query->set('cat','-18');
        }
        return $query;
    }
    add_filter('pre_get_posts','filterFeed');

    That stopped working with the upgrade to 3.1. Any leads on how to fix it?

  2. amandabee
    Member
    Posted 3 years ago #

    Solved, thanks to impworks. I'm over flowing with gratitude. Really.

    function filterFeed($query) {
        if ($query->is_feed) {
          $query->set ('category__not_in', '18' );
        }
        return $query;
    }
    add_filter('pre_get_posts','filterFeed');

Topic Closed

This topic has been closed to new replies.

About this Topic