I'm trying to add the total number of comments made on an article on my site to an RSS feed using FeedBurner.
In the control panel of FeedBurner there is "FeedFlare" which will allow me to add an option "Comments Count"
Lists the number of comments posted to an item. This Flare only works with self-hosted WordPress sites or other systems that use the wfw:comments element in the feed.
I've tried add the following in my RSS/XML but it doesn't seem to work
<wfw:comments xmlns:wfw="http://wellformedweb.org/CommentAPI/"><?= $comment_count ?></<wfw:comments>
AndroidPolice have managed to do it, but I can't figure out anything as I cannot find any way of acces开发者_开发技巧sing their raw RSS location.
The code you're using is a bit out of step with that Feedburner is expecting.
What you want is <wfw:commentRss>
(case-sensitive) which is supposed to point to the comments feed of the post.
Pair that with the <slash:comments>
tag right before the closing </item>
tag for a pair like this:
<wfw:commentRss>http://example.com/path/to/comments-feed/</wfw:commentRss>
<slash:comments>13</slash:comments>
The comment count will be taken at a snapshot of whenever Feedburner creates the cache of your feed so may not be exact when it appears in the feed reader.
精彩评论