Languages: English • Italiano • (Add your language)
This function returns a link to the feed for all posts in the specified category. A particular feed can be requested, but if the feed parameter is left blank, it returns the 'rss2' feed link.
<?php get_category_feed_link( $cat_id, $feed ); ?>
Return the rss2 feed link for post in category 2
<?php get_category_feed_link('2', ''); ?>
Display an rss link automatically when viewing a category. Insert this code on the category.php or archive.php page template.
if ( is_category() ) { $category = get_category( get_query_var('cat') ); if ( ! empty( $category ) ) echo '<div class="category-feed"><a href="' . get_category_feed_link( $category->cat_ID ) . '" title="' . sprintf( __( 'Subscribe to this category', 'appthemes' ), $category->name ) . '" rel="nofollow">' . __( 'Subscribe!', 'appthemes' ) . '</a></div>'; }
get_category_feed_link() is located in wp-includes/link-template.php
.