One of the Geeknews articles recently topped 80+ comments and I figured it would be interesting to turn on Gravatars to see what popped up beside the names. However, most of the posts didn’t have Gravatars associated with their e-mail, so I’d either just turn it back off or end up having to add yet another a plug-in to enable autogenerating an avatar for those folks. I was leaning toward’s Shamus’ Wavatars.
Lucky me, it looks like as of a few months ago, Gravatar has added Wavatar support along with two other avatar generators so no plug-in is required now; how convenient! Thank you Shamus and Gravatar!
BTW, since my theme didn’t have Gravatar support built-in originally, I’ve added the following to my comments.php:
<?php if(!empty($comment -> comment_author_email)) {
$md5 = md5($comment -> comment_author_email);
$size = 32; // size in pixels squared
$default = urlencode(‘wavatar’);
echo “<img src=’http://www.gravatar.com/avatar.php?gravatar_id=$md5&$size&default=$default’ alt=” />”;
}
?>
Before I learned that Wavatar support had been added to the backend at Gravatar.com, $default was “http://geeknews.net/images/no_gravatar.jpg“. As you can see it wasn’t very attractive, so being able to mix it up with something interesting is a nice touch.
For Wavatar support, just append your image source Gravatar URL request with ?d=wavatar (here’s gravatar’s implementation page).
Or, instead of “wavatar” you could pass in “monsterid” or “identicon”.
If you’re not familiar with any of these, here’s some examples, each commenter’s unique avatar is generated either randomly or based on their IP:
![]()