WordPress.org

Support

Support » How-To and Troubleshooting » [Resolved] Controlling RSS Feed via category inclusion?

[Resolved] Controlling RSS Feed via category inclusion?

  • magslhalliday
    Member

    @magslhalliday

    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?

Viewing 7 replies - 1 through 7 (of 7 total)
  • lexhair
    Participant

    @lexhair

    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

    magslhalliday
    Member

    @magslhalliday

    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!

    lexhair
    Participant

    @lexhair

    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/

    Alternatively, the category visibility plugin will do what you want:

    RYO ‘Category Visibility’ WordPress Plugin

    magslhalliday
    Member

    @magslhalliday

    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…

    magslhalliday
    Member

    @magslhalliday

    Thanks, lexhair! That seems to have solved it!

    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.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘[Resolved] Controlling RSS Feed via category inclusion?’ is closed to new replies.