Mark has been involved with WP RSS Aggregator for almost a decade, from running customer support to now leading RebelCode, the company behind the plugin, as CEO. He has a passion for content and news, especially the concept of ethically sharing content to help each other grow.
In fact it’s a function that’s built right into WordPress, but one that very few know of.
We’ve all come across a post that has a long (and I mean LONG) list of comments associated with it. Keeping track of these comments can be hard for the author, let alone the readers.
The Fix
This is why WordPress offers the following function to provide an RSS feed specifically for the comments of a particular post.
Place it inside your theme template in the appropriate location of your choice. (The code will generate the output, so there is no need for echo )
Place it inside a handler of a hook such as wp_list_comments_args. This will output the link right before where the comments our output using the wp_list_comments function. The handler should look something like this:
function my_wp_list_comments_args( $args ) {
post_comments_feed_link( '» Comments RSS Feed' );
// Don't forget to return the original arguments
return $args;
}
add_filter( 'wp_list_comments_args', 'my_wp_list_comments_args' );
How It Works
Calling this line of code will simply call the post_comments_feed_link() function that provides an RSS feed for the comments of a specific post, making it easier for your readers to keep track of those many, many comments.
Mark has been involved with WP RSS Aggregator for almost a decade, from running customer support to now leading RebelCode, the company behind the plugin, as CEO. He has a passion for content and news, especially the concept of ethically sharing content to help each other grow.
Mark has been involved with WP RSS Aggregator for almost a decade, from running customer support to now leading RebelCode, the company behind the plugin, as CEO. He has a passion for content and news, especially the concept of ethically sharing content to help each other grow.
Find out how content curation can help your business thrive by providing valuable information to your audience and easing your content production burden.
Think RSS aggregation is spammy, low quality, or even illegal? Think again. We bust the top 20 myths about content aggregation and show how WP RSS Aggregator for WordPress makes it legal, ethical, powerful, and surprisingly easy.
Mark Zahra
Table of contents
Streamline your
content-sharing process
Get started with WP RSS Aggregator today and unlock the full potential of RSS feeds!
RSS Tricks: How To Provide an RSS Feed for a Post’s Comments
This RSS trick isn’t much of a trick at all.
In fact it’s a function that’s built right into WordPress, but one that very few know of.
We’ve all come across a post that has a long (and I mean LONG) list of comments associated with it. Keeping track of these comments can be hard for the author, let alone the readers.
The Fix
This is why WordPress offers the following function to provide an RSS feed specifically for the comments of a particular post.
Now there are 2 ways that you can implement this:
How It Works
Calling this line of code will simply call the post_comments_feed_link() function that provides an RSS feed for the comments of a specific post, making it easier for your readers to keep track of those many, many comments.
Source: WP Recipes
Article by
Mark Zahra
Article by
Mark Zahra
Related Articles
What Is Content Curation? A Comprehensive Explanation
Find out how content curation can help your business thrive by providing valuable information to your audience and easing your content production burden.
What is a Curation Website? (Including Examples)
If you are just getting into content curation, you might not know exactly what kind of website you need. So, what is a curation website?
Top 20 RSS and Content Aggregation Myths Busted
Think RSS aggregation is spammy, low quality, or even illegal? Think again. We bust the top 20 myths about content aggregation and show how WP RSS Aggregator for WordPress makes it legal, ethical, powerful, and surprisingly easy.