WordPress.org

Ready to get started?Download WordPress

Forums

PE Category Filter
Need to exclude a category from main feed but allow it to work in its own feed (1 post)

  1. AnotherOpus
    Member
    Posted 6 months ago #

    Hello good people,

    Can your plugin: PE Category Filter

    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/pe-category-filter/

Reply

You must log in to post.

About this Plugin

About this Topic