July 16, 2005

Personalize the 'comments' text

All blogger blogs by default have comments hard coded into the HTML. It doesn't matter how many you have it will appear to be X comments. You can use the code below to change this depending on how many you have.

Example:
to
to

In your Template, Find:
<$BlogItemCommentCount$> comments


Replace with:
<script type="text/javascript">
<!--
var num = <$BlogItemCommentCount$>;
if(num == 0) { document.write('No comments'); }
else if(num == 1) { document.write('1 comment'); }
else { document.write(num + ' comments'); }
-->
</script>


You can make the comments say whatever you want it to say for any number of comments. The text above is just a suggestion.

3 Comments:

Hey! That's great to know! Xanga has a feature where you can change your comments/eprops to say what you want and I've been wondering how to do that with Blogger. Me and some friends have a Tip O Da Day page...can we use this tip on our page of we reference your blog page and give you credit?

Also, is there a way to know how many hits your blog gets? Like a counter or something?
posted by Blogger Lalah DeSha at 2:19 PM  
Hi Lalah,

Sure you can use this on your tip of the day page.

This blog doesn't get very many visits a day. :(
posted by Blogger Interblogger at 7:24 AM  
I wanted to let you know that your comments tip is today's tip of the day on the tips website. You can visit it at http://tips.petervcook.com. I also created a link to your website so people can check it out. Thanks again!
posted by Blogger Lalah DeSha at 9:07 PM