WordPress.org

Ready to get started?Download WordPress

Forums

Creating RSS feed by using only some of the categories? (3 posts)

  1. WPChina
    Member
    Posted 8 years ago #

    I need to create an RSS feed for only one category and another RSS feed for only 3 categories on my blog. I currently have 9 total categories.

    I searched for a plugin and found one but its instructions were not in English (esl_categories_feed.php), so I don't understand what to do. Can anyone point me to a plugin or method of crafting RSS feeds for specific categories, or even for specific posters/users?

    Tks!

  2. Kafkaesqui

    Posted 8 years ago #

    You can specify one or more categories through the url query for your feed. Using default permalinks and the numeric ID for the categor(y|ies):

    ?feed=rss2&cat=1

    And with custom permalinks:

    /feed/rss2/?cat=1

    For multiple categories, just separate them with a comma:

    ?feed=rss2/&cat=1,7,11
    /feed/rss2/?cat=1,7,11

  3. ratbastid
    Member
    Posted 8 years ago #

    I want to use that to create Feedburner feeds pointed at various categories. I actually want to "feedburn" one feed for one category, and another for everything else. Problem is, Feedburner barfs on URLs with commas in them.

    I'm trying to hack WordPress so it accepts another character (a hyphen, specifically) as the category separator, but I can't find where that work gets done. I added this to the very top of wp-rss2.php and to index.php, but it didn't make any difference:


    if (isset($_GET['cat'])) {
    $_GET['cat'] = preg_replace('/-/', ',', $_GET['cat']);
    }

    When I do that, the comma-separated list of cats in the query string still works, but a hyphen-separated list gives me all posts.

    I can't seem to find any reference to $_GET['cat'] or $request['cat'] in any of the code!

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags