RSS Feed
Nov 29

WP Plugin: “Feed Comments Number”

Posted on Saturday, November 29, 2008 in Coding

So I made a WordPress plugin (by request) that adds an image to the bottom of each item in your RSS feed showing the number of comments on that post and links back to the comments section of that post. It’s a really un-creative name for the plugin, but that’s not really all that important. I want to say FeedBurner will add this type of thing if it can correctly parse your feed’s wfw:comments tag, but it’s never worked amazingly for me and not everyone wants / needs to use FeedBurner so I made this. I actually use it myself (and had done a similar type of thing in the past, but more manually). The reason you use an image to do this is because javascript isn’t allowed in RSS feeds, and many times feeds are cached so it would never update text in it unless the last-modified attribute was changed (which WordPress doesn’t do if there are new comments on it).

Right now it allows you to set the background color and the color of the text, as well as choose from two fonts that I included along with it. There’s also the option to upload your own .ttf font files to generate the text. There are plenty of places to find those, so that should allow for more customization (the above examples are with the Arial.ttf font). I’m planning on making it to where the text that’s shown when there are no comments is settable as well as the format of the way the comments are displayed.

Update (0.2): You can choose the text shown if there are no comments on that post in the plugin options as well as choose how to format the text to show the comment number on those that have comments. You can also optionally have the image link displayed in your feed excerpts as well.

the admin options page for the plugin

the admin options page for the plugin

the current admin options for the plugin

There have been 68 downloads since I posted it to WordPress’s plugin directory, which is somewhere in the neighborhood of 66 more than I had expected considering I really just made this for a friend. So if anyone has any feedback or suggestions, you are more than welcome to leave a comment here or on the appropriate WordPress forum for the plugin.