New here? Be sure to subscribe to the RSS feed so you don't miss anything!
With Automattic acquiring Gravatar, there’s a obviously a great chance that Gravatar continues to become more and more the standard for WordPress. Until then, though, MyBlogLog still has a solid foothold in the avatar arena, and many of your blog’s readers use it faithfully. Why should you have to choose one or the other for avatars on your blog?
Now you don’t. This WordPress Avatars plugin allows you to support Gravatar and MyBlogLog avatars on your WordPress blog at the same time. It tries Gravatar first but then fails over to MyBlogLog if the commenter isn’t using Gravatar. It also allows you to specify a custom default image for those commenters who aren’t currently using either service.
There are other methods out there that do this in a much cleaner way, but those leave your readers’ email address exposed to the public in plain text — something you definitely don’t want to do.
Getting Started
- Download the plugin file and upload it to your /wp-content/plugins folder.
- Activate the plugin from the Plugins page of your WordPress control panel.
- Edit the comments.php file for your WordPress theme and add this line of code within the
foreach ($comments as $comment)loop wherever you want the avatar to appear:<?php if(function_exists("showavatar")) showavatar(); ?>
That’s all there is to it. Please take it for a spin and let me know what you think!
Important Note
The avatar image cannot have a CSS width or padding associated with it. If you need to use either attribute, set it on a DIV surrounding the avatar IMG tag instead of on the avatar IMG tag itself. Trying to set it on the IMG will cause a Stack Overflow error in Internet Explorer and an infinite loop in Firefox.
Update Log
Version 0.55 (May 7, 2008): Removed a line of debug code that was disabling Gravatar and fixed the spelling of Alex’s name.
Version 0.6 (May 12, 2008): Fixed a bug that several people had seen where MyBlogLog wasn’t returning an image for certain URL/name combinations.
Karl
August 5, 2008 at
8:24 pm
Hi, great plugin.
I was wondering, however, if someone could post an example of how to change the avatar’s image size without breaking the plugin.
I really need this image to be a 60×60 instead of the default 48×48.
Thanks in advance!
Karl
Shane
August 6, 2008 at
11:22 am
Regrettably, MyBlogLog only has a 48×48 image and doesn’t give you the option of changing it like Gravatar does. If you specified the width on the image in order to make it a different size than MyBlogLog’s default, it breaks the functionality because the plugin has to check the width of the image in order to determine which image retrievals were successful.
So for now, we’re stuck with 48×48 if you want to be able to use both MBL and Gravatar