WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Using Gravatars Other Than in Comments (4 posts)

  1. inSaneELF
    Member
    Posted 4 years ago #

    Hi,

    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?

    Thanks.

  2. inSaneELF
    Member
    Posted 4 years ago #

    Hate to bump this, but it's something I'd really like to have answered. Surely there's a way to do this?

  3. 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; ?>
  4. inSaneELF
    Member
    Posted 4 years ago #

    Awesome thanks!

Topic Closed

This topic has been closed to new replies.

About this Topic