A Category with no rss feeds

Community Forums Forums General Discussion A Category with no rss feeds

This topic is: not resolved

Tagged: ,

This topic contains 1 reply, has 2 voices, and was last updated by  cdils 1 year, 10 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #22196

    itsfashionbaby
    Participant
    Post count: 1

    I have a blot about children’s fashion and would like to make a category about a completely different subject – but still keep it on my blog.

    Is it possible to make a category in wordpress, that isn’t included in the rss feeds from my blog?

     

    Thanks in advance :)

    #22221

    cdils
    Participant
    Post count: 423

    Hi there,

    I found this bit of code that should work if you drop it into your functions.php (Note, anytime you edit functions.php, be prepared to FTP in or otherwise access your file to quickly correct any errors, as a syntax error in the file will cause your site not to work).
    function myFeedExcluder($query) {
    if ($query->is_feed) {
    $query->set(‘cat’,’-12′); //Change the category ID to be your category’s ID
    }
    return $query;
    }
    add_filter(‘pre_get_posts’,’myFeedExcluder’);
    To get the ID of your category, just go to your Category page in your dashboard and hover your mouse over the desired category. Then, while the mouse is still hovered, look at the URL bar in the bottom of your browser and it will show the ID # in the string. :)

    Carrie


    Have you been helped in this forum? Pay it forward and answer someone else’s question. I bet you’ll know the answer to at least one question. :)

    I host a weekly Genesis-focused podcast called Genesis Office Hours. I tweet @cdils.

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.