Home » WordPress Tutorials » You are reading »

Gravatar And Mybloglog Avatar Integration

mybloglog-gravatar.gif

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.

:mrgreen:

Related Topics:

WordPress Tutorials
Building Your Website with WordPress? Learn How to Optimize it
WordPress Tutorials
How to Detect Mobile or Tablet Condition in WordPress
WordPress Tutorials
Designing and Protecting Your WordPress Site is Easier Than You Think
WordPress Tutorials
The Ultimate SEO Tips For Your WordPress Blog
http://cdn.dezzain.com/1/2008/03/mybloglog-gravatar.gifRichie KS WordPress Tutorialswordpress codingok..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... DEZZAIN.COM
Enjoy This Article?, Follow us or Share it smiley
viral and buzz WordPress theme

4 Comments Already

  1. Now, in Version 2.5 + Themes, This features is inbuilt.

    Public CommentUserNow, in Version 2.5 + Themes, This features is inbuilt.
  2. Worked like a charm dude thanks a million 😯

    Public CommentUserWorked like a charm dude thanks a million :shock:
  3. 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.

    Public CommentUserhi, 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.
  4. What/Where is the “comment loop” exactly? Is that the Comment.php file under wp-admin-> presentation-> theme editor-> Comments?

    Public CommentUserWhat/Where is the "comment loop" exactly? Is that the Comment.php file under wp-admin-> presentation-> theme editor-> Comments?

Write a Reply or Comment

Your email address will not be published. Required fields are marked *


You can wrap php, js or style css code with [PHP]..your code...[/PHP]