Forums

Exclude Category from Main Feed, but keep Category Feed (7 posts)

  1. miralize
    Member
    Posted 9 months ago #

    Hi all,

    Currently having an issue where the feed on the main site has categories discluded, but the content in one of the categories that is discluded needs to have its own feed so I can output it somewhere else. Currently I have

    function exclude_category_feed($query) {
     if ($query->is_feed) {
       $query->set('cat','-2249,-1985,-2567');
     }
    return $query;
    }
    add_filter('pre_get_posts','exclude_category_feed');

    But I do need to get that category "2249"'s feed, currently it outputs

    <rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" version="2.0">
    <channel>
    <title>
    Simply Zesty » Simply Viral – A Video of the Day, Every Day
    </title>
    <atom:link href="http://www.simplyzesty.com/category/viralvideos/feed/" rel="self" type="application/rss+xml"/>
    <link>http://www.simplyzesty.com</link>
    <description>Building your brand through social media</description>
    <lastBuildDate>Fri, 12 Aug 2011 16:29:25 +0000</lastBuildDate>
    <language>en</language>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <generator>http://wordpress.org/?v=3.2.1</generator>
    </channel>
    </rss>

    Thanks!

    Sean

  2. miralize
    Member
    Posted 9 months ago #

    anyone?

  3. cruxwireweb
    Member
    Posted 7 months ago #

  4. cruxwireweb
    Member
    Posted 7 months ago #

    Strike that - I'm getting a headers already sent error. I guess it's worth trying if you need it, though.

  5. cruxwireweb
    Member
    Posted 7 months ago #

    Did you find a solution Sean?

  6. brohism
    Member
    Posted 5 months ago #

    Was a solution ever found for this?

  7. Martyn Chamberlin
    Member
    Posted 4 months ago #

    We SERIOUSLY need to figure out how to do this. I'm googling like crazy...

Reply

You must log in to post.

About this Topic