[wp-hackers] Per Post comment feed...feature or accident?

Otto otto at ottodestruct.com
Tue Jul 31 14:51:52 GMT 2007

The default and classic themes both show the Comments RSS feed links
in the page footers. Those are for the whole site though.

The default theme also shows this on single pages: You can follow any
responses to this entry through the RSS 2.0 feed.

While the classic theme shows this: RSS feed for comments on this post.

Both of which contain links to the feeds. So, if your theme was doing
the right thing, you'd have that link.

I use the following code in my theme's header to add the
automatic-browser feed links:

<link rel="alternate" type="application/rss+xml" title="<?php
bloginfo('name'); ?> RSS Feed" href="<?php bloginfo('rss2_url'); ?>"
<link rel="alternate" type="application/rss+xml" title="<?php
bloginfo('name'); ?> RSS Comments Feed" href="<?php
bloginfo('comments_rss2_url'); ?>" />
<?php if (is_single()) { ?>
<link rel="alternate" type="application/rss+xml" title="<?php
the_title(); ?> RSS Comments Feed" href="<?php echo comments_rss();
?>" />
<?php } ?>

This lets the browser see the main feed, the whole-blog comments feed,
and the single page comments feed if you're looking at a single page.

You can do similar things to add links specifically for category
pages, author pages, etc. Look at these functions:
get_author_rss_link, get_category_rss_link.

On 7/31/07, Christian Höltje <docwhat+list.wp.hackers at gerf.org> wrote:
> I read someone's wordpress blog and posted a comment and I thought to
> my self, "gee, it'd be nice if I could just subscribe to the comments
> for *this* post..."
> I putzed around for a while and discovered that if I added "/feed" to
> the end of the post's URL it would return comments ONLY for that post!
> Is this a feature or an accident of design?  I ask because there is no
> advertising of this URL.  If it is a feature, then someone should add
> the RSS links to the header and possibly to the sidebars...
> If it is a happy accident, can we make it official and add the links?
> Ciao!
> --
> Fact #44
>   Understanding the existing product is the most difficult task of maintenance.
>                 -- "Facts and Fallacies of Software Engineering"
>                         (Robert L. Glass, 2002)
> The Doctor What: Hoopy Frood                     http://docwhat.gerf.org/
> docwhat *at* gerf *dot* org                                        KF6VNC
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers

More information about the wp-hackers mailing list