WordPress.org

Support

Support » How-To and Troubleshooting » [Resolved] is it possible to link to an rss feed for just 1 specific category??

[Resolved] is it possible to link to an rss feed for just 1 specific category??

  • 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 ?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Chris_K

    @handysolo

    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/)

    Kafkaesqui

    @kafkaesqui

    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):

    <?php
    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>

    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.

    Thanks!

    Kafkaesqui’s response was bang on the money for me – thanks very much!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘[Resolved] is it possible to link to an rss feed for just 1 specific category??’ is closed to new replies.
Skip to toolbar