"If you can get along with everyone and everyone loves you, then you don't stand for much. A person who stands his ground for his principles and won't compromise his integrity is not loved by everyone."
- Larry Winget

Display Gravatar Avatars on Your Web Site

In my tutorial on how to display twitter status messages in WordPress, I used my own avatar picture beside the speech bubble. I have not found a way to retrieve my Twitter avatar from Twitter. Hopefully, I will figure out how to do it in the near future.

An alternative way to organize my avatars would be to use Gravatar. Gravatar allows you to display your avatar through a simple URL.

The Normal Avatar Code

1
<div id="twitter_photo"><img src="%3C?php%20echo%20bloginfo%28%27template_directory%27%29;%20?%3E/images/icon-twitter.jpg" alt="" width="73" height="73" /></div>

The Gravatar Avatar Code

1
<div id="twitter_photo"><img src="http://www.gravatar.com/avatar.php?gravatar_id=%3C?php%20echo%20md5%28" yourgravatar@email.com="" );="" ?="" />" width="73" height="73" alt="" /&gt;</div>

You should replace “your...@email.com” with the email address of your Gravatar avatar email address. With Gravatar, I no longer need to upload and manually change the code whenever I update my avatar. Now, I only need to edit it from Gravatar and all my sites will display the updated avatar.

Tagged As: , , ,

Posted by Vincent on 26 November 2008 3:45 AM in Web Development, Wordpress Help You can leave a comment, or trackback from your own site. |

Similar Posts

Did You Enjoy This Post?

Subscribe to our blog through our RSS feed or email to receive updates on more posts like this. post on your favourite social networking or media site to let others know about this post. Help us generate more buzz by submitting/voting for this post with the following buttons.

1 Trackback On “Display Gravatar Avatars on Your Web Site”

Post a Comment


(Required)


(Required)