Last day when I was converting a wordpress theme into Blogger I saw the comment numbering in the wordpress theme and I tried to show the Comment numbering in that Blogger Theme.So I searched the hack to show comment numbering and Finally found that hack in randomness.
It was not so hard to show comment numbering in Blogger.It is just like showing commentators photo inside comments in Blogger.So I have brought this hack to you.Just follow the tutorial below.
Goto Blogger Edit Html page , Expand Widget Templates and Search for the Following block of codes.
<b:loop values=’data:post.comments’ var=’comment’>
<dt class=’comment-author’ expr:id=’”comment-” + data:comment.id’>
<a expr:name=’”comment-” + data:comment.id’/>
<b:if cond=’data:comment.authorUrl’>
<a expr:href=’data:comment.authorUrl’ rel=’nofollow’><data:comment.author/></a>
<b:else/>
<data:comment.author/>
</b:if>
<data:commentPostedByMsg/>
</dt>
<dd class=’comment-body’>
<b:if cond=’data:comment.isDeleted’>
<span class=’deleted-comment’><data:comment.body/></span>
<b:else/>
<p><data:comment.body/></p>
</b:if>
</dd>
<dd class=’comment-footer’>
<span class=’comment-timestamp’>
<a expr:href=’”#comment-” + data:comment.id’ title=’comment permalink’>
<data:comment.timestamp/>
</a>
<b:include data=’comment’ name=’commentDeleteIcon’/>
</span>
</dd>
</b:loop>
</dl>
Now in second step , replace the above block of codes with the following block of codes.
<script type=’text/javascript’>var CommentsCounter=0;</script>
<b:loop values=’data:post.comments’ var=’comment’>
<div class=” expr:id=’data:comment.id’>
<dt expr:class=’”comment-author ” + data:comment.authorClass’ expr:id=’data:comment.anchorName’>
<a expr:name=’data:comment.anchorName’/>
<b:if cond=’data:comment.authorUrl’>
<a expr:href=’data:comment.authorUrl’><data:comment.author/></a>
<b:else/>
<data:comment.author/>
</b:if>
<data:commentPostedByMsg/>
<span class=’comment-number’>
<a expr:href=’”#comment-” + data:comment.id’ title=’Comment Link’>
<script type=’text/javascript’>
CommentsCounter=CommentsCounter+1;
document.write(CommentsCounter)
</script>
</a>
</span>
</dt>
<dd class=’comment-body’>
<b:if cond=’data:comment.isDeleted’>
<span class=’deleted-comment’><data:comment.body/></span>
<b:else/>
<p><data:comment.body/></p>
</b:if>
</dd>
<dd class=’comment-footer’>
<span class=’comment-timestamp’>
<a expr:href=’data:comment.url’ title=’comment permalink’>
<data:comment.timestamp/>
</a>
<b:include data=’comment’ name=’commentDeleteIcon’/>
</span>
</dd>
</div>
</b:loop>
</dl>
Now in last Step you need to style the numbering.For that add the following codes just above ]]></b:skin>: in your Template.
float: right;
display: block;
width: 50px;
margin-right: 5px;
margin-top: -35px; /*comments-counter position*/
text-align: right;
font-family: ‘Century Gothic’,'Lucida Grande’,Arial,Helvetica,Sans-Serif;
font-size: 30px;
font-weight: normal;
}
/*since the numbers are actually links, we need to force the color properties*/
.numberingcomments a:link, .numberingcomments a:visited {color: #445566 !important; text-decoration: none !important;}
.numberingcomments a:hover, .numberingcomments a:active {color: #FF9933 !important; text-decoration: none !important;}
After you complete the above steps,Save the Template and see the comment numbering in your blog.If yu got any problem then let us know about it.
Consider to Subscribe to our RSS feed or Follow us at Twitter or Join our Facebook Fan Page.Enter your Email below to subscribe to our updates via Email.
Similar Posts
- Show Commentators Photo inside comments in Blogger
- Show top labels or labels having more posts at label widget
- Show inline comment form below each of your blog posts
- Create auto expandable posts (or auto readmore) in blogger with image thumbnails
- Create auto Expandable Posts in Blogger with no image thumbnails













{ 5 comments… read them below or add one }
cool hack!
this is best and easy steps….THANX
Thanks for the publicity! XD
I would like to learn how to do this for the Blogger Classic templates.
.-= Stefani´s last blog ..Cool And FREE Twitter Tools =-.
One of the main feature of using third party comment system is Reply option to comments which blogger lack.
I recently saw this tutorial on How to add reply option to blogger comments and thought to share with you
{ 1 trackback }