Feeds for post comments

On the individual posts page, we can add a feed to allow users to subscribe to the comments on a particular post. Sometimes a single post on a blog can draw a lot of attention, with dozens or hundreds of people adding comments. People who comment, and even those who don't comment, may be interested in following the thread, or subscribing to it.

Using your FTP software or the built-in WordPress theme editor, edit the single.php file in your theme folder. If you're using the theme we built during Chapter 6, find the code that we added in it, which includes the comments template <?php comments_template(); ?> and add this code just before it:

<p><?php comments_rss_link('Subscribe to these comments'); ?></p>

(If you are not using the theme we built in Chapter 6, you can add the above text anywhere in single.php so long as it is inside the if and while loops of the loop.) Now when you look at a single post page, you'll see the subscription link just above the comments form:

The Accidental Blogging Millionaires

The Accidental Blogging Millionaires

Get Inspired By The Most Popular Bloggers Online! If You Want To Skyrocket Your Success With Business And Improve Your Overall Life You Need To Have A Look At The Accidental Blogging Millionaires! Business can be a fight, particularly when you’re trying to establish one online and like all fights, to succeed you must find the winning techniques and apply them.

Get My Free Ebook


Post a comment