WordPress.org

Forums

[resolved] Controlling RSS Feed via category inclusion? (8 posts)

  1. magslhalliday
    Member
    Posted 9 years ago #

    I'd like to set up my RSS feed so that it only includes posts from the 'editorial' category. I've looked at the plugins and the only one I could see which was close was Feed Control by slipstream. However, that works on a per post exclusion system (where you define which post ID numbers to exclude) instead of a per category inclusion system (where you define the category ID to include).

    Has anyone got a plugin which does this, or notes on how to edit the templates to do this?

  2. lexhair
    Member
    Posted 9 years ago #

    It's supported natively. If you are using pretty permalinks, your feed is:
    http://yourhost.com/yourblogdirectory/category/editorial/feed/

    If that fails you can use:
    http://yourhost.com/yourblogdirectory/wp-rss2.php?cat=6
    if the category is 6. More info is here:
    http://codex.wordpress.org/WordPress_Feeds

  3. magslhalliday
    Member
    Posted 9 years ago #

    The problem with that is that it doesn't suppress the other categories i.e. if a user hits the RSS sub icon on the home page, they get the lot.

    I can do it by excluding individual posts, but that seems a very long and arduous way around things!

  4. lexhair
    Member
    Posted 9 years ago #

    I think I understand what you want to do. You want to change the autodiscovery RSS feed address. You need to go into the header.php file for your theme and make a backup copy.

    Since you didn't provide a link to your blog, I'm flying a little blind here but find the line inside the head tags that specifies the RSS feed. Usually it looks something like this:
    <link rel="alternate" type="application/rss+xml" title="<?php bloginfo('name'); ?> RSS Feed" href="<?php bloginfo('rss2_url'); ?>" />

    Replace the <?php bloginfo('rss2_url'); ?>
    with http://yourhost.com/yourblogdirectory/category/editorial/feed/

  5. Alternatively, the category visibility plugin will do what you want:
    http://ryowebsite.com/?p=46

  6. magslhalliday
    Member
    Posted 9 years ago #

    Thanks, Otto42, but that won't help. I want posts in other categories visible when at the site, but not included in the feed. I'll try lexhair's solution and report back...

  7. magslhalliday
    Member
    Posted 9 years ago #

    Thanks, lexhair! That seems to have solved it!

  8. Thanks, Otto42, but that won't help. I want posts in other categories visible when at the site, but not included in the feed.

    Actually, then it will help, because that plugin lets you specify what categories are visible where... including the feed. You can hide categories from the feed and still allow them on the homepage.

    Really. Try it before dismissing it. Also gives a cleaner URL for your feed.

Topic Closed

This topic has been closed to new replies.

About this Topic