Displaying Distributed Comments on the Hardboiled Blog

One of the nuts of aggregating mother blogs that was tough to crack for a long while was showing the number of comments on posts that were syndicated in. Almost two years ago  Martha Burtis cracked that nut for ds106. I’ve been using a similar spoke/hub model of syndication for the Hardboiled fiction class I’m teaching this semester, so I asked Martha to take me through the process yesterday.  She did, and what was awesome is how easy she has made the process. It’s really pretty seamless to hack your theme to show distributed comments. In this example I’m doing it with the old gold Twenty Ten WordPress theme because despite what Tim Owens says Twenty Eleven has always been butt ugly.

A couple of things upfront, there is still a bug that requires those blogs that are syndicating in to have pretty permalinks turned on to show the correct number of comments. Otherwise the comment count will resort to the number of posts on that blog up and until 10. In other words, if the blog has 6 posts only the comment count will be 6 if it has ten or more posts the comment count will always be ten until pretty permalinks are enabled. Don’t ask me why, I am just the messenger 🙂 I still have to get my students to turn on pretty permalinks, so the comment count you see on the Hardboiled aggregator blog might be off for a few more days.

The other thing to keep in mind is that this will only show comments for WordPress blogs that are syndicating in. Showing comments for Blogger, Tumblr, Posterous, etc., is not an option with this method as of yet.

Ok, with all of that said, here is how we did it for the Hardboiled course blog which is hosted on UMW Blogs.

First, we created a child theme for the default Twenty Ten theme and but it in a theme folder called hardboiled. We then add a style.css file to the theme folder with the following code:

Theme Name: Twenty Ten -- Hardboiled Child Theme
Description: Child theme for the Jim's Hardboiled Lit Class
Author: Jim Groom
Template: default
Version: 0.1.0

@import url(“../default/style.css”);

This is pretty simple, and the one line of code basically tells the theme to import all the styles from the default theme on UMW Blogs.  What’s more, any custom styles added beneath that line will take precedence over any styles in the default theme. That’s just a basic overview of how child themes work, nice to be reminded of this—I’m so WordPress remedial these days 🙂

Next, Martha included a custom Twenty Ten loop.php file that she hacked that actually does all the work. She dropped this in the child theme folder and it worked a charm. You can find the loop.php file here if you are interested in looking at Martha’s code and adapting it for other themes. Ideally this would be a plugin, but I really don’t know how that would work across themes or if it is even practical. And that’s that for showing distributed comment comment on the posts themselves.

Another thing Martha turned me on to which worked out really well was bundling comments for the 16 blogs in the class using Google Reader so that I could pull an ATOM feed into a RSS widget that will display all the recent comments across all 16 blogs. The Recent Comments widget on the Hardboiled course blog is doing just that, and it truly ties the room together 🙂

Google Reader is powerful, but strangely unintuitive when it comes to creating new folders or finding this RSS feed, so let me do a quick howto, fully understanding the rules for doing this could change at any moment in the future.

First, create a new folder in Google Reader in which you will add all the feeds for comments on the blogs to be aggregated and syndicated. To do this you need to go to Reader Settings and then the Subscriptions tab.  After that you need to click on any of the “Change Folder” or “Add to a Folder” tabs and go to the very bottom option to add a new folder and do as much. See the screenshots below for details because this process is unnecessarily buried in the Google Reader interface:

After you have created a new folder now you have to add the feeds to it. This is pretty straight forward, just subscribe to the blog or blog comment feed and add it to the folder you just created.  After that, you’ll have a folder full of feeds that you can then turn into a bundle and grab the ATOM feed for. To create a bundle just select the downward facing arrow next to the folder and look for the Create a Bundle option.

After you select create a bundle you will see the following screen:

Name it and after that you’ll have it as one of your existing bundle which will provide you with a series of options. You can email it, create a clip (which is basically code that allows you to add the OPML file to your sidebar), Add a link (which is where you find the ATOM feed), and a straight-up OPML file. All pretty powerful options, but I used the Add a link option to grab the ATOM feed of all the latest comments across the 16 blogs.

Once I click the Add a link option I’m given the ATOM RSS feed that I can then add to a WordPress RSS widget in the Hardboiled sidebar. After that, I can display distributed recent comments on the mother blog to give any and all visitors a better sense of where the conversation is happening.

This entry was posted in Hardboiled, UMW Blogs, WordPress and tagged , , , , , . Bookmark the permalink.

One Response to Displaying Distributed Comments on the Hardboiled Blog

  1. Pingback: Visualizing cMOOC data: Extracting and analysing data from FeedWordPress part 1 #ds106 #NodeXL JISC CETIS MASHe

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.