Support » Requests and Feedback » RSS feed for each category

  • I’m trying to keep the categories as nearly virtual separate blogs.

    I’m really liking word press (particularly the RSS feature) but there doesn’t seem to be a way someone can get an RSS feed for all posts in an individual category.

    I’ve searched the codex without finding it. If this feature already exists I would apprecaite a pointer. Otherwise I would like to make it a feature request.

    Thanks,

    Dewey
    dewey@sasser.com

Viewing 15 replies - 16 through 30 (of 34 total)
  • Luckily, the implementation I’m working on is an older version of WP1.5.2 🙂 it works nicely…

    What I’m really looking for though is a way to visually list the category feeds, on their own, for users to easily access.

    I know you can list the feeds *next* to the categories, but I want a clean list of category feed links for users to access.

    Or, as described above, even a link to the category feed from the category page. That would help…

    I wish I could code php…. 🙁

    Anyway, thanks for replying!

    How about something like this:
    <a href="/wordpress?feed=rss2&cat=<?php
    $cat = get_the_category(); $cat = $cat[0]; echo $cat->cat_ID;
    ?>">SUBSCRIBE</a>

    I think this is more portable:


    <?php if (is_category()) {?>
    <a href="<?php get_category_rss_link(1,intval( get_query_var('cat'))); ?>">Subscribe</a>
    <?php } ?>

    This is interesting but not quite what I’m looking for. I need a list of the category specific feeds associated with that post. The categories the post is filed in.

    Suggestions?

    Lorelle: You’re saying that you want to get a link for a categories feed, for a specific post? So this would be in the loop then? I’m just trying to see what you’re doing.

    Generally, you can append “feed/” to most anything you see and get a feed of it. For example, http://lorelle.wordpress.com/tag/blog-babble/feed/ is the feed of your “Blog Babble” category. But the correct way to do this is to call get_category_rss_link() with the category id. Since you might have multiple categories in a post, you can do it like this:

    <?php foreach((get_the_category()) as $cat)
    {
    echo '<a href="';
    get_category_rss_link(true,$cat->cat_ID,$cat->category_nicename);
    echo '">'.$cat->cat_name.'</a>';
    }
    ?>

    This must be in the loop. It will spit out the names of the categories, comma separated, with each name being linked to its feed.

    This is brilliant, though the spit out didn’t include commas. Just a mashed together space-less line of categories. I’ve been digging through tons of code and can’t find how to include the commas. Fixy, please! 😉

    Thanks so much! I’ve been poking at this for months without success. And you were right. I should have been more clear about the use being in the Loop on a single post (in the post meta data section). Thanks!

    Bah. I forgot the commas. Silly me.

    In the above code, change this:
    '</a>';

    to this:
    '</a>, ';

    It’s the little things that matter. Perfect fix. THANKS!!!

    Oh, Otto42, and anyone else paying attention. It didn’t work.

    <?php foreach((get_the_category()) as $cat)
    {
    echo '<a href="';
    get_category_rss_link(true,$cat->cat_ID,$cat->category_nicename);
    echo '">'.$cat->cat_name.'</a>, ';
    }

    Returns:

    Categoryone, categorytwo, categorythree, .

    Note the additional comma and the space then period. Is there any way to make this generate the list with the commas, but recognizing NOT to put the last comma in at the end? The space and period thing I can deal with. The comma period, that ain’t so nice.

    Thanks.

    Sure. Picky, ain’t ya? 😉

    <?php
    $cats = get_the_category();
    $num = count($cats);
    for($i=0; $i<$num; $i++)
    {
    $cat=$cats[$i];
    echo '<a href="';
    get_category_rss_link(true,$cat->cat_ID,$cat->category_nicename);
    echo '">'.$cat->cat_name.'</a>';
    if ($i != $num-1) echo ', ';
    }
    ?>

    Yes, I know. I’m a raging nit-picker. And you are a total star. Give me an “and” before the last category and you are a celebrity! HA! I ask for so much, but then, I expect great things from my wonderful WordPress gurus.

    Okay, I’m slightly kidding. It would be sweet to have the “and” but this is fabulous. Thank you so much.

    I think this slight change will add the “and” you’re looking for.

    <?php
    $cats = get_the_category();
    $num = count($cats);
    for($i=0; $i<$num; $i++)
    {
    $cat=$cats[$i];
    echo '<a href="';
    get_category_rss_link(true,$cat->cat_ID,$cat->category_nicename);
    echo '">'.$cat->cat_name.'</a>';
    if ($i == $num-2) { echo ', and '; }
    else if ($i != $num-1) { echo ', '; }
    }
    ?>

    I could reach through this screen and hug the ever-loving life out of you, Otto!!!! Brilliant. THANK YOU. KISSES!

    I have attached the above script to my footer, works almost perfect, but for some reason it is dropping categories.

    http://austinpublic.com/category/events/

    I have posts in All Events, Community and Music, but Music is not showing up, any idea why?

    Thanks for the great script though, I love it!

    Otto42 I tried putting your last bit of code in my sidebar and got nothing. I am on 2.4

    I really dont need a list of all feeds, I just need the feed for one particular category

Viewing 15 replies - 16 through 30 (of 34 total)
  • The topic ‘RSS feed for each category’ is closed to new replies.