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.
Share Your Opinions
Tell us what you're thinking...
and if you want a pic to show with your comment, then get gravatar!
Please make sure that you have read our Comment Policy.










What Next?
Digg itSave This Page
Subscribe to WPBeginner
Stumble it
Related Posts