Saturday, January 8, 2011

How to Number your Comments

Please Note: be sure to back-up and save your current template to your computer. That way you can go back and reinstall it if you make a mistake. To save your current template click on
"Design" > "Edit HTML" > "Download Full Template"

I have a review and giveaway site and for the longest time I would have to count each comment to find the winner that Random.org chose. I would have on average about 100-200 comments and it got very frustrating when Random.org chose comment #85 or something like that.

Having numbers on my comments was a life-saver so I would like to share how I did it with you.

Step 1:  Log into Blogger and click on "Design" then "Edit HTML"

Step 2:  Put a check mark in the "Expand Widget Templates" box

Step 3:  Press Ctrl+F and find the following code:
<dl id='comments-block'>

If you can't find that code then look for this one:
<dl expr:class='data:post.avatarIndentClass' id='comments-block'>

Step 4:  Right under that line of code, paste the following:
 <script type='text/javascript'>var CommentsCounter=0;</script>

Step 5:  Press Ctrl+F again to find this code:
<b:if cond='data:comment.authorUrl'>

Directly ABOVE that code copy and paste the following:
<br/><span class='numberingcomments' style='float:left;font-size:20px;'><a expr:href='data:comment.url' title='Comment Link'><script type='text/javascript'>CommentsCounter=CommentsCounter+1;document.write(CommentsCounter)</script></a></span><br/>

Step 6:  Click "Save Template"

ShareThis

Blog Hops Everyday Blog Hops Everyday
Related Posts Plugin for WordPress, Blogger...