Conditional Image for comments.
-
Hi there,
I’m designing a custom theme for a friend, and he wants the talking-bubble icon I put next to “% Comments” to change according to the amount of comments.
Like this:
If a post has 1 comment, you would see [image.gif] “1 Comment”
If the post has more than 10 comments, you’d see [image2.gif] “15 Comments”
If the post has more than 50 comments, you’d see [image3.gif] “51 Comments”
I tried a couple of things, but only got as far as:
<?php comments_popup_link(__('<img src="0.gif">'), __('<img src="1.gif">'),> __('<img src="%.gif"> '));?>
Which is no good at all, since I don’t need an image for each number.
If anyone could help me, that would be great. If you want to refer me to a codex page or an older thread that would be appreciated too. I searched, but couldn’t find anything besides the above piece of code.
Thanks!
- The topic ‘Conditional Image for comments.’ is closed to new replies.