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.

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

Here's how to accomplish this:

  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:
    <div class="entry-meta">
    <?php twentyeleven_posted_on(); ?>
    </div><!-- .entry-meta -->
    

    ... and replace it with this:

    <div class="entry-meta">
      <? echo get_avatar( get_the_author_meta('user_email'), $size = '50'); ?>
      <?php twentyeleven_posted_on(); ?>
    </div><!-- .entry-meta -->
    

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'); ?>
Did you find this article helpful?

We value your feedback!

Why was this article not helpful? (Check all that apply)
The article is too difficult or too technical to follow.
There is a step or detail missing from the instructions.
The information is incorrect or out-of-date.
It does not resolve the question/problem I have.
How did you find this article?
Please tell us how we can improve this article:
Email Address
Name

new! - Enter your name and email address above and we will post your feedback in the comments on this page!

Like this Article?

Post a Comment

Name:
Email Address:
Phone Number:
Comment:
Submit

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

News / Announcements

WordPress wp-login.php brute force attack
Updated 2014-07-17 06:43 pm EST
Hits: 200886

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

Need more Help?

Search

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: support@InMotionHosting.com
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!