How to Display Author’s Gravatar Pic, Photo In WordPress Posts

display GravatarDo you want to display the author picture in your wordpress posts? You can do it easily with the help of Gravatar. Read our earlier post about the “What is Gravatar?” and “Gravatar in a New Avatar”. Read on…

Follow the simple steps given below to display the author’s pic anywhere in your wordpress blog.

1. ask all your author to attach a photograph to their email id’s through Gravatar.

2. Paste the following code, where you want the gravatar pic of author to be displayed:

<?php
$author_email = get_the_author_email();
echo get_avatar($author_email, '96');
?>

3. Number ‘96’ in the second line specifies the size of the pic to be displayed. (Here size will be 96×96 pixels)

4. You can change the size according to your requirements.

5. You can also put this code inside a Div tag to change the CSS properties of image displayed

Hope this tutorial helps to serve your requirement. If you face any problem, feel free to comment and I’ll try to solve them.

Comments are closed.

Follow us on Twitter! Follow us on Twitter!

daily email newsletter

Enter your email address:

Recent Posts

Video of The Day

Blogs Worth Visiting