Automatically add avatars to your web site
Jun 25th, 2008 by Richard
I was having a conversation with some friends about how easy it is to dynamically add an avatar (fancy word for picture) to your web site or blog.
There are some great uses for these pictures but I got the impression from my friends that they never heard of this before or never considered using it, so let me share with you how easy this is to set up on your site.
How it works
There is a service called Gravatar which is operated by the same people who created Wordpress. Gravatar does all the hard work for you of getting users signed up, resizing the photos, checking email addresses to match with photos etc.
All you need to do is add a couple lines of code to your blog or web site and you’re in business displaying people’s pictures beside their comment, opinion or site listing.
If you use Wordpress, the support is already built into 2.5 and higher. If you use an older version of Wordpress, you can still use Gravatar, just read this doc page to find out how.
If you want use it on a site other than Wordpress, then read this doc on how to do it. I have made a sample page to show you just how easy this is. The code for the sample page is here.
Who should use it
I use Gravatar on this blog, so go sign up for an account so that your picture can be displayed when you make comments. You only need to sign up once and then every time you comment on this blog, or other sites, your picture is automatically displayed.
NOTE: Your picture can be any picture, your face, a business logo, a blue box with red stars, whatever you want.
There are some sites that already use pictures for their authors or commentors but these pictures are manually prepared, re-sized and added to the sites. If you were to use Gravatar you could automate the whole process and enhance the user experience.
It only takes a line or two of code to set this up.
For example, the experts profiles on this auction site could automatically have a picture beside their profile and the feeds section of this aggregator site could have pictures added automatically to their list of contributors.
If you need any help setting this up on your site, make a comment below and I will be happy to assist you!









