Sometimes you may want to feature the post author in separate space inside the post like about author box, Here is a simple PHP code snippet which returns the current post authors Gravatar with a desired image size.

<?php echo get_avatar( get_the_author_email(), '80' ); ?>

Use the above PHP snippet inside post loop (single.php) to automatically retrieve post author gravatar. In above code the gravatar thumbnail size is 80*80px, Just change the parameter to increase or decrease the size (1px up to 2048px).

Now read this : Display Custom Avatar in Comments For Users Without Gravatar

or This one : Hide Installed Plugins from Dashboard : Users can not deactivate the Plugin

Thanks to Emoticode for this useful code snippet.


Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

CommentLuv badge