[resolved] is it possible to link to an rss feed for just 1 specific category?? (5 posts)

  1. gerld
    Posted 9 years ago #

    i haven't been able to figure out any information on rss feeds.

    if i have, say 9 or 10 categories.. is it possible i can give readers 1 link for just that specific category?

    i just want to define the link as an href at the top of my page.. so it doesn't need to be a complicated if else or anything like that. i just need the link. if that's possible

    is it ?

  2. Chris_K
    Posted 9 years ago #

    Yep. Built-in. WordPress_Feeds

    If you're using "pretty" Permalinks just add /feed/ to the end of the category link (ie http://yourdomain.com/blog/category/Personal/feed/)

  3. Kafkaesqui

    Posted 9 years ago #

    I'm not sure why the devs never thought to provide a simple template tag for this so the feed link can be generated dynamically. But the following bit of code will do what you're looking for (on a category query):

    global $wp_query;
    $category = $wp_query->get_queried_object();
    <a href="<?php get_category_rss_link(true, $category->cat_ID, $category->category_nicename); ?>"><?php echo $category->cat_name; ?> RSS Feed</a>

  4. mtakhar
    Posted 9 years ago #

    Just found this thread.

    I've added Kafkaesqui code to my archive.php around the if (is_category()) {..(line 8 ish) statement. I'm pleased to say it works well.


  5. f1f
    Posted 8 years ago #

    Kafkaesqui's response was bang on the money for me - thanks very much!

Topic Closed

This topic has been closed to new replies.

About this Topic


No tags yet.