Blogger: Comment Count hack

About a year ago, I posted my hack on Blogger User Support for getting a comment count in the sidebar like I’d seen on some WordPress blogs (again, this hack is for pre-Beta Blogger templates like this site). Shortly thereafter, the post was picked up by Freshblog and a little while after that, I ended up modifying the hack further to better match the color scheme and logic of this site:

Here’s the hack (goes in the the sidebar of the template):

<h2 class=”sidebar-title”>Recent Posts</h2>
<ul id=”recently”>
<BloggerPreviousItems>
<li><a href=”<$BlogItemPermalinkURL$>”><$BlogPreviousItemTitle$></a><span class=”class1″><a class=”comment-link” href=”<$BlogItemCommentCreate$>”<$BlogItemCommentFormOnclick$>” title=”comments”>(<$BlogItemCommentCount$>)</a></span></li>
</BloggerPreviousItems>

And here’s the CSS (goes in the body):

.class1 A:link {color: #999; text-decoration: none;}
.class1 A:visited {color: #999; text-decoration: none;}
.class1 A:active {color: #c60; text-decoration: none;}
.class1 A:hover {text-decoration: none; text-decoration: underline; color: #c60;}

Leave a Reply

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