Support » Themes and Templates » Using Gravatars Other Than in Comments

  • Resolved inSaneELF



    I would like to have a user’s gravatar display after they login. I tried using the get_avatar function, but that only seems to be usable with comments. How can I display a users avatar in a place other than comments?


Viewing 3 replies - 1 through 3 (of 3 total)
  • Hate to bump this, but it’s something I’d really like to have answered. Surely there’s a way to do this?

    Moderator Ipstenu (Mika Epstein)


    Lead Plugin Wrangler

    Sure. I do this in my sidebar so logged in user can see their pretty faces:

    <?php global $user_ID, $user_identity, $user_level ?>
              <?php if ( $user_ID ) : ?>
                   <?php if ( $avatar = get_avatar( $user_ID, $size = '50' ) ) : ?>
                   <?php echo $avatar; ?>
                   <?php unset($avatar); endif; ?>
              <?php endif; ?>

    Awesome thanks!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Using Gravatars Other Than in Comments’ is closed to new replies.