Per author avatar in WordPress

There are many blogs in “the wild” which are run by more than 1 person. Multiple authors contributing to a blog. Many of these blogs also run WordPress.
Now, most multiple user blogs in WordPress have a small writing somewhere below the post which informs the readers who wrote it. But sometimes, that ain’t enough. Large publications often use a per author mugshot to distinguish between authors.
There is an easy way of achieving this in WordPress.

First and foremost, upload the images, with a common extension, and the same name as the author’s first name, to a suitable location, say wp-content/images.

So, for users Bert and Ernie, I should have images Bert.png and Ernie.png. This is essentially important; so double check the names.

Now, within the loop, place the following code anywhere you fancy:

And your lovely mugshot will be out for the World to see!
A simple hack, yet something people rarely use or find.

6 Responses to “Per author avatar in WordPress”

  1. Steven Says:

    A simple, yet useful hack. Not much code written, but it’s a good idea.

  2. Indranil Says:

    Thank you. :)

  3. Marc Says:

    Very simple, very good.

  4. Dan Says:

    I’m giddy, this is so genius.

  5. Jule Says:

    Thx for this code! i was searching for sth like this, but this is the most simple one! genius!

  6. Tanner Says:

    you’ve saved me so many headaches. thanks!

Leave a Reply