• Hi, I have used WordPress for quite a while, and have a dilema of sorts now, I have a new blog and looking to have each category have it’s own separate RSS feed. The reason is that I need it for another site to pull the feed and display the RSS as HTML in an iframe. I can pull the main feed just fine using a PHP script, but if I can separate all the categories into separate feeds, I can populate multiple pages onto my other site with ease. Make sense?

    My other alternative is to find a way to change the script that pulls the feed so it will only pull specific categories, on each particular page will have a different script to retrieve the content, so, in effect resulting in the same product. But I have no idea on how to rewrite the code to do that either, lol.

    Any one with suggestions, or know of something to help me?

    TIA,

    Ken Clark

Viewing 15 replies - 1 through 15 (of 20 total)
  • WP creates out of the box category feeds.

    Thread Starter kenclark

    (@kenclark)

    Hmm, OK, that is very encouraging, I just spent the last hour in the admin section of my wordpress site, as well as on the site itself and can not find anywhere on it where it says, or reveals the feed url of the categories. I can find however the category link, that was evident from the beginning, but not an rss url to the category, without the entire page loading.

    i.e. https://www.yoursite.com/?cat=1

    Which loads the entire page. Any hint or formula for obtaining the RSS url of individual categories?

    Inquiring minds want to know..

    TIA

    Ken

    Some good stuff at WordPress_Feeds that you might look over.

    Thread Starter kenclark

    (@kenclark)

    Thanks Handy, yes, there is some very interesting things there. Now if I can actually understand what it says is another issue. It looks like I will have to alter the code to get WP to create an RSS feed for each category I post to.

    I did try a couple things to no avail, it seems I may have to alter the_loop.php file to get the rss for individual categories to actually write somewhere,
    if
    I am reading or understanding it correctly
    ELSE
    I am totally off base with what I am reading there, it’s mostly greek to me.
    If
    I have made it clear what I need, the answers I am getting are over my head.
    Else
    I have not made it clear what I am looking for and WP does not create category rss feeds out of the box.
    Else
    You guys are fishing for someone to pay you to give them the easy answer, lol J/K… (kinda)

    Ken

    You guys are fishing for someone to pay you to give them the easy answer, lol

    As an unpaid volunteer here, I’d like to say that you could not have written a more offensive statement.

    You need not make any code changes to get category feeds. As we’ve pointing out, they’re built in.

    I’d give you links to where yours are if you’d give a link to your blog.

    At my blog, I have a category called “Tech”. To lists posts in that category, the URL is: https://www.solo-technology.com/blog/category/tech

    To get a feed for that category, the URL is:
    https://www.solo-technology.com/blog/category/tech/feed

    If you’re using pretty Permalinks, you’d do the exact same thing.

    On the Codex page HS linked to, in Section 3, last example:

    You can also provide feeds to only specific categories on your site by adding the following to the end of the link:

    https://example.com/wp-rss2.php?cat=42

    I don’t think it can be clearer than that…

    Thread Starter kenclark

    (@kenclark)

    We11 thanks guys, that is appreciated greatly.

    Please, please dont be offended at my comment, I am well aware of your volunteer status and had no desire of being rude. I must have an -off- sense of humor.

    Handy, Moshuand all the rest, have a great day…

    Ken

    Suppose you want to provide a link to the RSS feed at the head of a category archive page. How would you generate that automatically?

    If not the feed link, then the URL of the specific category, to which “feed/rss2/” could be added. This can be done in The Loop with the_category().

    Or the category slug, which can be prefixed by “www.domain.com/blogdirectory/category/” and followed by “feed/rss2/”. This can be done in The Loop with get_the_category().

    Outside of The Loop, I get the name of the category with single_cat_title(), but that returns the name, not the slug (e.g., Rhode Island instead of rhode-island).

    Moderator Samuel Wood (Otto)

    (@otto42)

    www.ads-software.com Admin

    Something like this should work…

    if (is_category())
    {
    $cat_obj = $wp_query->get_queried_object();
    $cat_id = $cat_obj->cat_ID;
    echo '<a href="';
    get_category_rss_link(true, $cat, '');
    echo '">Category RSS Link</a>';
    }

    HS: Some good stuff at WordPress_Feeds that you might look over.

    Anyone know why that Codex page doesn’t tell you how to use Author feeds? It mentions Category feeds only, and Author feeds are very similar.

    I just answered someone’s question about how to find the Author feeds, in another thread here yesterday.

    I’ve never tried editing the Codex — being not an expert myself — what’s the best way to suggest this is written into the Codex on that page HS linked?

    If you create an account on the Codex – writing/editing is almost as simple as posting here ??
    Also, if you don’t want to mess with it, you can add/suggest the changes on the “discussion” page of any article.

    Thanks, I never knew about the Discussion page in the Codex (it is only seen after logging-in, and the Codex requires a separate login from the forums even if exact same username).

    I posted my suggestion in the Discussion there ~ does anyone actually read it?
    https://codex.www.ads-software.com/Talk:WordPress_Feeds

    There weren’t any other Discussion items, I “made” the page

    Here’s what I came up with: the first is nonhierarchic, the second full hierarchy. I use te first to appear at the top of a category archive page.

    <a href="https://www.wind-watch.org/news/category/
    <?php
    $theCategory = single_cat_title("",false);
    $theCategorySlug = $wpdb->get_var("SELECT category_nicename FROM $wpdb->categories WHERE cat_name='$theCategory'");
    print $theCategorySlug;
    ?>
    /feed/rss2/"><font "style="background:#FF6600;color:#FFFFFF;font-size:92%;" "><b>&nbsp;RSS2&nbsp;</b></font> for this category</a>
    <a href="
    <?php
    $theCategory = single_cat_title("",false);
    $theCategoryID = $wpdb->get_var("SELECT cat_ID FROM $wpdb->categories WHERE cat_name='$theCategory'");
    $theCategoryLink = get_category_link($theCategoryID);
    print $theCategoryLink;
    ?>
    feed/rss2/"><font "style="background:#FF6600;color:#FFFFFF;font-size:92%;" "><b>&nbsp;RSS2&nbsp;</b></font> for this category</a>

    and like I said in the other thread this plugin,

    https://perishablepress.com/press/2006/08/07/category-livebookmarks-plus/

    already does that.

    You obviously didn’t read the page I linked.

    Don’t take it personally, whooami. Of course I read about your plug-in, and I was grateful for your suggestion. But, as I noted on the other thread, it did not appear to do what I needed, which is simply to automatically provide the link to the category RSS feed on that category’s archive page. Your insistence only referred to the description already on your plug-in page without clarification or extra description to answer my question. Besides, adding a few lines of PHP to my index page is much better than adding another plug-in.

Viewing 15 replies - 1 through 15 (of 20 total)
  • The topic ‘RSS feed for each Category, Possible?’ is closed to new replies.