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:

Blogging Profits Unleashed

Blogging Profits Unleashed

Already know that blogs are an essential element of your online business but just don't know HOW to gain a slice of the pie? Discover What You Need To Know About Setting Up and Running a Successful and Profitable Blog, Quickly and Easily.

Get My Free Ebook


Post a comment