Gravatar And Mybloglog Avatar Integration
ok..users tend to drawed to using either gravatar or mybloglog avatar to implement an identity to the commentator..what if you want to used or switch from gravatar and mybloglog without any hassle. Here’s a simple integration you can input into your comment loop.
Using original source from gravatar integration Tip #6: Add Gravatars Without a Plugin from WPDesigner by Milo
Implement Method In Comment Loop
- <?php if(function_exists(“MyAvatars”)) : ?><?php MyAvatars(); ?><?php else: ?>
- <?php $pathtotheme = get_bloginfo(‘stylesheet_directory’); ?> <!– this is so you can input your own site no-avatar image rather than default one from gravatar –><?php if(!empty($comment -> comment_author_email)) {$md5 = md5($comment -> comment_author_email);$default = urlencode(“$pathtotheme/images/no-avatar.gif“);echo “<img src=’http://www.gravatar.com/avatar.php?gravatar_id=
$md5&size=48&default=$default’ alt=’commenter’ />”;}?> - <?php endif; ?>
that’s it..easy right. Bold text in code above are editable according to your images location and avatar size. In order to make the gravatar and mybloglog avatar size the same, open your style.css and add this line to bottom of your css or any location you desired
- img.MyAvatars
{
height: 48px;
width: 48px;
}
change the bold height and width to the same dimension size as your gravatar.

Now, in Version 2.5 + Themes, This features is inbuilt.
Worked like a charm dude thanks a million 😯
hi, i’ve tried using the code provided in my WP theme, but all it did was totally mess up the comments section… i already have an image for gravatar…..
this is the current code in my comments.php:
<img src=”/images/mygif.gif” alt=”mygif”/>
would appreciate your help.
you can check out my website where it’s all the default image.
What/Where is the “comment loop” exactly? Is that the Comment.php file under wp-admin-> presentation-> theme editor-> Comments?