• Posted by Tim Jarrett
  • On February 6, 2009

  • Filed under Website

  • 1 Comment

Now serving Gravatars

WordPress 2.5 and later have built-in support for Gravatars — site-independent avatars. They’re basically small pictures that can appear next to your comments across multiple sites, depending on the email address you registered with the main Gravatar site.

I hadn’t gotten around to hacking the theme I’m using–which apparently predates WP 2.5–for Gravatar support, but (per the Codex) adding the support was trivial. I added this line of code in the comments loop and was all set, aside from some trivial additions to the CSS to display the gravatar in the right place:

<?php
echo get_avatar( $comment, $size = '48' );
?>

You can see what it looks like below. And if you sign up with the service, when you leave a comment on my blog your avatar (G-rated only–my blog policy enforces it) will appear next to your comment. Nice trick.

One comment...What do you think?

  1. Posted by Tim Jarrett 6th February, 2009 at 5:53 pm

    This is a test post showing my Gravatar.

What do you think? Join the discussion...

Note: Please be aware of the comments policy on this blog.