Beginner's Guide for WordPress - Start your WordPress Blog in minutes.
Choosing the Best
WordPress Hosting
How to Easily
Install WordPress
WordPress Plugins
View all Guides

How to Display Author’s Gravatar on their Individual Posts in WordPress

Last updated on by
Special WordPress Hosting offer for WPBeginner Readers
How to Display Author’s Gravatar on their Individual Posts in WordPress

There are many blogs now that have more than one author. Sometimes reader can’t distinguish it easily who wrote it because usually the author credentials are small. Therefore in this article we will show you how you can add an author’s gravatar image in their individual posts.

This tutorial is really easy to follow. You don’t need any big plugin. Just a short snippet of code. You would need to create an author’s profile and add the email address which is also registered with gravatar. Once you have done that follow the directions:

First you need to open single.php and/or index.php, and then add the following code where you see fit.

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

Basically this code will take the email you entered in the author’s profile and try to fetch the gravatar associated with that email. The 48 value represents the size in pixels which you can change to match your design formatting.

Editorial Staff at WPBeginner is a team of WordPress experts led by Syed Balkhi. Page maintained by Syed Balkhi.

WPBeginner's Video Icon
Our HD-Quality tutorial videos for WordPress Beginners will teach you how to use WordPress to create and manage your own website in about an hour. Get started now »


  1. vivi says:

    nice info. thank you :)
    but now, we should use get_the_author_meta(’email’) instead because get_the_author_email() is deprecated

  2. Si Sai says:

    i have multiple authors for my wp blog and i want to display avatars of each author, for the individual post they have submitted ?

  3. KHOKON says:

    Hi, Thanks a lot, It’s working to my theme, I was looking such a tips. Thanks again.

Add a Comment

We're glad you have chosen to leave a comment. Please keep in mind that all comments are moderated according to our comment policy, and all links are nofollow. Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.