InMotion Hosting Support Center

If you'd like to show the author's avatar within a WordPress post, we'll show you how in this article. While the functionality is not built into WordPress (version 3.2.1 as of this writing), you can surprisingly accomplish this task with just one line of code.

In this article we'll update the top part of the post that says "Posted on" so that it shows the authors avatar. Refer to the screenshots below to see the results.

In this article, you will learn how to show an author's avatar within WordPress.

Before: After:
before showing wordpress author avatar after showing wordpress author avatar

Showing an Author's Avatar in WordPress

  1. Log into your WordPress Dashboard
  2. In the left menu, under "Appearance", click "Editor"
  3. On the "Editor" page, find and click "content.php" in the list of files on the right of the page
  4. Find this section of code:

    ... and replace it with this:


    That's it, you're done! In this tutorial we placed the author's avatar at the top of the post (for the homepage). If you'd like show the author's avatar from anywhere else within the post (or on other pages), simply use the following code:

      <? echo get_avatar( get_the_author_meta('user_email'), $size = '50'); ?>

Congratulations, now you know how to show an author's avatar within WordPress!

Was this article helpful?

Related Questions

Here are a few questions related to this article that our customers have asked:
Ooops! It looks like there are no questions about this page.
Would you like to ask a question about this page? If so, click the button below!
Ask a Question

Forum Login

You are NOT logged in. You can still browse our Support Center.

To participate within our Community Support Forum:

n/a Points
2018-06-01 2:09 am

Working good, but if i add <img> tag of html and echo it in src its not working so how can i add css to it to display a round image instead of sqare 

3,737 Points
2018-06-01 4:17 pm
As I understand, Gravatars are by default square. You maybe able to find a plugin that allows you to customize the Gravatar shape.
n/a Points
2017-05-04 1:37 am


By using the above code, I'm getting only thumbnails.Any way to retrieve the bigger images? Please help.

13,821 Points
2017-05-04 7:15 am
You can adjust the size of the avatar by changing the 'size=50' to a larger number.
n/a Points
2018-01-14 11:59 am

it does not work for me. Just display a transparent png image.

42,829 Points
2018-01-15 9:42 am
The direct reference for doing this can be found in the offical WordPress Codex on this page. If you continue to have problems we would need more information about the issue in order to investigate in more depth.
n/a Points
2017-04-17 4:02 pm
Also after displaying user avatars within wordpress you can set so many different effects to avatars using a new useful free plugin Avatars Effects ( This plugin will help you set beautiful and interesting effects on avatars without writing any css code..
n/a Points
2016-05-31 2:21 am

Great Great Great. i was looking for this fro last 12 hours with lot of google search and headache but didt found solutions, and your post worked like a magic for me


Bundle of thanks again dude :)

n/a Points
2015-11-17 10:11 pm

You wouldn't necessarily have to make a child theme or re-do the changes in the theme. You could set up a plugin that filters the_title or the_content and returns the avatar with it.

42,829 Points
2015-11-18 10:14 am
Hello Megan,

Thanks for your comment! We probably need to update this article as the handling of Avatars has definitely changed in WordPress with the latest versions. Thanks for your input!

If you have any further questions, please let us know.

Kindest regards,
Arnel C.
n/a Points
2017-03-30 12:59 pm

And that will never happen.

n/a Points
2017-03-30 12:55 pm

So when is that tutorial going to get made?

31,539 Points
2017-03-30 5:30 pm
Hello Kev,

There is currently no time-frame for when this guide will be updated, but the information is covered in the official WordPress Codex.

Alternately, there are many plugins available for adding an Avatar in WordPress.

Thank you,
n/a Points
2015-10-19 10:23 am

To avoid having to do this you need to set up a child theme.

n/a Points
2015-03-09 3:50 pm

What happens when there is an update to WordPress. THe user will have to manually re-insert the changes again.

43,761 Points
2015-03-10 10:24 am
Hello Zion,

I would think so. Any time a core file is modified it should be expected that it will need to be redone after an update.

Kindest Regards,
Scott M

Post a Comment

Email Address:
Phone Number:

Please note: Your name and comment will be displayed, but we will not show your email address.

18 Questions & Comments

Post a comment

Back to first comment | top

Need more Help?


Ask the Community!

Get help with your questions from our community of like-minded hosting users and InMotion Hosting Staff.

Current Customers

Chat: Click to Chat Now E-mail:
Call: 888-321-HOST (4678) Ticket: Submit a Support Ticket

Not a Customer?

Get web hosting from a company that is here to help. Sign up today!