WordPress.org

Ready to get started?Download WordPress

Forums

Always get a default avatar in my comments (3 posts)

  1. chacsam
    Member
    Posted 6 years ago #

    Hi,

    Since I have installed the 2.5.1 and installed the advised code, I alwys get the default gravatar displayed.
    Can anyone help?

    The code is in the comments loop after:
    <?php foreach ($comments as $comment) : ?>
    And looks like this

    <div class="gravatar">
       <?php if (function_exists('get_avatar')) {
          echo get_avatar($email, $size='60');
       } else {
          //alternate gravatar code for < 2.5
          $grav_url = "http://www.gravatar.com/avatar.php?gravatar_id=
             " . md5($email) . "&default=" . urlencode($default) . "&size=" . $size;
          echo "<img src='$grav_url'/>";
       } ;?>
       </div>

    Thanks

  2. Anonymous
    Unregistered
    Posted 6 years ago #

    i think you have to try and wait for gravatar.com to update your image, they take there time on doing that, due to server related issues.

    http://www.picbi.com

  3. transmothra
    Member
    Posted 5 years ago #

    See here.

    In the comment loop, you wanna do this:
    echo get_avatar( get_comment_author_email(), '96', $default = '' );

    Hope that helps!

Topic Closed

This topic has been closed to new replies.

About this Topic