One thing I am really excited about is that Gravatars are really starting to gain popularity now that Automattic has purchased and is supporting them. And now that support is built right into WordPress, it opens up a lot of options for WordPress users.

The most common place you’ll find a Gravatar is usually with an individual comment to help comments stand out.  Another place you will sometimes see them is in the sidebar, like we have it setup here at Hack WordPress.   One thing, however, that people are slowly coming around to is using Gravatars with blog posts to identify the author of the post. This is something that is a great idea for a multi-author blog and something I’ve considered doing on this website.

So, how would you go about setting up Gravatars to display with each individual post? Over at ThemeShaper, Ian Stewart recently shared an easy way to do this. You just need the following code:

<?php echo get_avatar( get_the_author_email(), '64' ); ?>

When used, WordPress will match up the e-mail address associated with the post author to determine what Gravatar to use. The 64 is the size (pixels) of the Gravatar.

Great find Ian!

Kyle Eslick is WordPress enthusiast who took his passion for WordPress to the next level in 2007 by launching WPHacks.com as a place to share hacks, tutorials, etc. Follow Kyle on Twitter @KyleEslick!

  1. Thank you for this very helpful info! I am putting together a multiblog post and want to have individual gravatars for the different authors.

  2. zwars says:

    great post, it seems it works

  3. Galoor says:

    Hmmmmm. I will give this a try. Hopefully it works on the latest version of WP! Thanks 🙂

  4. tonis says:

    thank you very helpful

Trackbacks/Pingbacks »

  1. 100+ Killer Wordpress Resources | Steffan Antonas' Blog says: