Tutorials, tips and tricks about Blogger

31 Dec

Change the message next to the number of comments on Blogger

6 Comments | by in Design, Tutorials | 2009

Español Português

By default, every post we publish on Blogger has a link with the number of comments (if it’s enabled, of course), and it says something like "0 Comments", and this isn’t the best presentation. Another problem comes when the post has just one comment, and the link shows "1 Comments", which is not logical at all. Finally, when the post has more than one comment, the link get a little bit of sense. But don’t worry about it, cause now we’re gonna teach you how to fix it.

1. Go to the “Layout” tab, also called “Design” from the desktop, and then go to “Edit HTML”. After this, check the “Expand widgets template” box.

Dashboard → Layout → Edit HTML → Expand widgets template

2. Search for the following code:

<b:if cond='data:post.allowComments'>
<a class='comment-link' expr:href='data:post.addCommentUrl' expr:onclick='data:post.addCommentOnclick'><b:if cond='data:post.numComments == 1'>
1 <data:top.commentLabel/>
<b:else/>
<data:post.numComments/> <data:top.commentLabelPlural/>
</b:if>
</a>
</b:if>

And replace it with the following:

<b:if cond='data:post.allowComments'> <a class='comment-link' expr:href='data:post.addCommentUrl' expr:onclick='data:post.addCommentOnclick'> <b:if cond='data:post.numComments == 0'> Leave your comment </b:if> <b:if cond='data:post.numComments == 1'> 1 Comment </b:if> <b:if cond='data:post.numComments > 1'> <data:post.numComments/> Comments </b:if> </a> </b:if>

3. Now search for the following code:

<b:if cond='data:post.allowComments'>
<h4>
<b:if cond='data:post.numComments == 1'>
1 <data:commentLabel/>:
<b:else/>
<data:post.numComments/> <data:commentLabelPlural/>:
</b:if>
</h4>

And replace it with this:

<b:if cond='data:post.allowComments'> <h4> <b:if cond='data:post.numComments == 0'> Leave your comment </b:if> <b:if cond='data:post.numComments == 1'> 1 Comment: </b:if> <b:if cond='data:post.numComments > 1'> <data:post.numComments/> Comments: </b:if> </h4>

Both of the replacements are because of the link will show up twice: on main page and on each post’s page. The bold text can be changed for anythig you want tho show.

Vía: blogandweb.com

Comments

6 Comments, leave a reply · Feed · Trackback URI
  1. Nice trick..thanks

  2. Hey, thanks for posting this!
    Really – it’s a great help :]

  3. Can I change the text 10 comments to 10 Awesome Comments?

  4. Thanks for this code, it worked … just what I was looking for.

  5. This can be use for my future work. Thanks for sharing.

  6. i am looking for this for a long time, im glad i’ve found your blog , keep up the good work about blogger customization and blogger help.

Reply

Thank you for your comment! If it contains links, your comment will be moderated. Please, don't spam :)

Tutorials, tips and tricks about Blogger