You are here: Home » Wordpress » How To Get Gravatar Image By Email Address In WordPress

How To Get Gravatar Image By Email Address In WordPress




28ecf26b027a982f34fa3d98ce1424ef

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 :
<?php
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.

By HackingEthics

Tags:

Leave a Reply

blog comments powered by Disqus
Get Adobe Flash playerPlugin by wpburn.com wordpress themes
Copyright © 2009 Hacking Ethics. All rights reserved.
Designed by Theme Junkie. Powered by WordPress.
Thank you for using IGIT Tweet Share Button, a plugin by HackingEthics