• Resolved ifelse

    (@ifelse)


    Does anyone have any ideas on how to publish a RSS feed that excludes posts from a certain category?

Viewing 4 replies - 1 through 4 (of 4 total)
  • To hit ?feed queries, place this in your blog’s root index.php (before the wp-blog-header.php include):

    if(isset($_GET['feed'])) {
    $cat=-1;
    }

    $cat needs to be assigned a negative value of the category ID to exclude. If instead you point to the various feed scripts (wp-rss2.php etc.), just add in each of them:

    $cat=-1;

    Thread Starter ifelse

    (@ifelse)

    Thanks Kafkaesqui, should have thought of that myself:-)

    For anyone else with the same issue, what you can also do is make an additional check on the ‘category_name’ get variable so that this category is not excluded from category feeds.

    Translating ifelse’s note into geek:

    if(isset($_GET['feed']) && !(isset($_GET['cat']) || isset($_GET['category_name']))) {
    $cat=-1;
    }

    Thread Starter ifelse

    (@ifelse)

    “Translating ifelse’s note into geek”
    Thanks:-)

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Excluding categories from RSS feed’ is closed to new replies.