Display Author Gravatar in the Loop

If you want to display an author’s Gravatar, this little code should do the trick (note that it only works inside the Loop):

<?php echo get_avatar( get_the_author_meta('user_email'), 48 ); ?>

The second parameter dictates the size of the avatar. More about get_avatar().

You may also like...

3 Responses

  1. GTA 5 says:

    Thanks for this tip!

  2. If you want to display an author’s Gravatar

  1. April 2, 2011

    […] Display Author Gravatar in the Loop […]

css.php