A reader e-mails to ask how to hack the blogger comments code to make the post count grammatically correct... Comments (0), Comment (1), Comments (2), that sort of deal. Now, I'm pretty sure I've seen this somewhere before, but I can't recall where, which is why I'm opening the floor & hoping you'll remind me!
Filed in: blogger blogspot blogtech comments blogger-hacks
<script>
var number=<$BlogItemCommentCount$>;
if(number==1){
document.write('<a href=\"<$<$BlogItemPermalinkURL$>$>#comments\">Comment \(1\)</a>'); }
else{
document.write('<a href=\"<$<$BlogItemPermalinkURL$>$>#comments\">Comments ("+number+")</a>');
}
</script>
Should do the trick?
<script type="text/javascript">var a = <$BlogItemCommentCount$>;
if(a == 0) {document.write('No comment');}else if(a == 1){document.write('1 comment');}else {document.write(a+' comments');}</script></a>
peace...
annie
In my post I suggest doing it like this:
-- css --
1com: {display:none; }
-- text in link --
commment<span class="<$BlogItemCommentCount$>com" >s</span>
The hardest part was finding a logical css class name for it. I've tried 1s and 1ass but it didn't look right. And 1grammarnatzi is to long.
I know it isn't as big as your scripts and it's only css1 but it works. The sad part is that the missing (s) makes people think about other things as posting the comment. And of course the page gets bloated from it. lol
Maybe you can repost some things from my blog. I did make the scripts to be used. Doesn't look like it's going to happen.lol
I'm looking for new ideas to make, have any ideas? Is there something left that wordpress can do but blogger cant?