How To Get Gravatar Image By Email Address In WordPress

Hello Friends, Yesterday I was trying to make author bio after every post, So i need to get related Gravatar image by user email address to show in author bio after every post. I have searched about it on internet and fianlly found one wordpress function by which we can find gravatar image of user by email address. Below is the function and explanation that how can we use it :
echo get_avatar( $id_or_email, $size = '96', $default = '<path_to_url>' );

  1. id_or_email (required): Author’s User ID (an integer or string), an E-mail Address (a string) or the comment object from the comment loop.
  2. size (optional): Avatar display size (max is 512).
  3. default (optional): Absolute location of the default avatar to use (used when the person has no email address associated with them).

By this way you can get Gravatar Image of user by Email address or Id. Let me know if you have any question in this. I will try to help you in this.

  1. November 20, 2012 at 6:11 AM

    Thanks for sharing these steps. I have been looking for it all over the web. So many a thanks for this.

  1. October 22, 2010 at 11:53 PM

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: