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

In many WordPress multi-author blogs, you may see gravatar image of the author near the title of the post. It helps readers easily distinguish the author of the post. Although, WebTips is a single author blog, you will see my gravatar image near the title.

Display Author’s Gravatar on their Posts in WordPress

Most of the themes and frameworks not support this and show author gravatar image icon near the title of the post. But what if your theme does not support this feature? I saw many blogger searching for the plugins to add this kind of author photo feature. But, you do not need to worry about this. You can do this without using any kind of plugin.

Read: How to Split a Single WordPress Post in Multiple Pages

Just put this code where you want to show the author gravatar photo.

This code is simple to understand. get_the_author_email() function fetches the email of the author and get_avatar() function puts the gravatar image of the author. Number 48 is the size of the image in pixels. You can change it according to the space available in your design format.

Be sure to create a gravatar account and then upload your picture before using this. If you have not added photo to gravatar, it will show default gravatar photo in place of your photo.


About The Author


Subscribe To Our Newsletter

Subscribe To Our Newsletter

Receive fresh web design resources and SEO tips in your email by our weekly newsletter

You have Successfully Subscribed!