I’ve been playing around with WordPress 2.5 and a new theme on the blog over the last few days, and must say that I am quite impressed with all the new bells and whistles.
One of the newer inbuilt features, Gravatar has been especially interesting. The Gravatar site has this to say when defining a gravatar
A gravatar, or globally recognized avatar, is quite simply an avatar image that follows you from weblog to weblog appearing beside your name when you comment on gravatar enabled sites. Avatars help identify your posts on web forums, so why not on weblogs?
Now Gravatars have actually been around for a while, but they have been gaining in popularity expecially since Automattic recently acquired gravatar and WordPress 2.5 released with inbuilt support.
Adding Gravatars to your wordpress theme is fairly easy, all it requires is calling the new get_avatar() function in your comment template php file
<?php echo get_avatar( $comment, $size = '96', $default = '<path_to_url>' ); ?>
where $comment is the authors id and is a required field, $size controls the size of the avatar and $default is the path to your default image.
Now, whenever someone makes a comment on your site, if they have a predefined gravatar, it will show up otherwise your default image will appear.
Initially my default avatar looked something like this
However while reading the gravatar blog recently, I came across this article, which talks about gravatar’s new support for Identicons, MonsterID, and Wavatars.
In a nut shell what these projects try to do is uniquely identify users, using information like IP addresses so that they can generate random images which are then unique to that user, so that whenever they leave a comment on your blog, instead of being presented with the default image they are also treated as part of the ‘family’
This led me to play with the $default value in the get_avatars() function and I came across an undocumented feature, if I change the value of $default, my gravatar changes as well!
If you try any of the following,
echo get_avatar( $comment, $size = '96', $default = 'wavatar' ); OR echo get_avatar( $comment, $size = '96', $default = 'monsterid' ); OR echo get_avatar( $comment, $size = '96', $default = 'identicon' );
you can automatically see the changes to the default gravatars, which is pretty cool (at least in my opinion)
So now I can get unique avatars for each commenter (who are not already using gravatar)
At the moment for some reason only wavatar seems to be working, the others are throwing ‘504 Gateway Time-out’ errors The others seem to be back up now.