Today, numerous blogs have multiple authors. The reader can have a hard time in finding out who wrote the article as the author credentials are small. In this article, let’s discuss on how you can display author’s gravatar image in their posts.
This is an easy to follow step. You don’t need any plugins. Just a short code snippet. You will have to create an author’s profile and add their email address registered with gravatar. Post that, read through the article:
Let’s Add the Code Which will Display Author’s Gravatar
Open the single.php and/or index.php, and then add this one-line code snippet:
<?php echo get_avatar( get_the_author_email(), '64' ); ?>
This code takes the email you entered in the author’s profile and will try to fetch the gravatar associated with that email. The 64 value represents the size in pixels which you can change according to your needs.