WordPress.org

Forums

Ultimate Category Excluder
Need to exclude a category from main feed but allow it to work in its own feed (2 posts)

  1. AnotherOpus
    Member
    Posted 1 year ago #

    Hello good people,

    Can your plugin: Ultimate Category Excluder

    Do this:

    I need to allow a category to feed in it's own feed E.g.

    http://domain.com/category/categoryX/feed/

    BUT -- I must exclude that feed from the site feed:

    http://domain.com/feed/

    I tried adding the below linked PHP to the functions.php and it keeps the categoryX feed out--but it also STOPS the categoryX feed completely!

    SEE:

    http://premium.wpmudev.org/blog/how-to-exclude-a-category-from-your-wordpress-feed/

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

    Thank you for your help!

    Chris

    http://wordpress.org/plugins/ultimate-category-excluder/

  2. rushboy2112
    Member
    Posted 11 months ago #

    seconding this motion, I have a need to exclude a Category from the main site search, but not within its own Category site search.

    this would mean allowing a Post to display on a search that has this at the end of the URL

    ?s=search+term+here&cat=91

    but not within the main site search

    this may be completely impossible -- I believe it's either/or. But it couldn't hurt to ask.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Ultimate Category Excluder
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic