WordPress

How To Display Author Avatar In Post

Gravatar

In WordPress you can assign avatars to your authors, but if you have avatars then you need to be able to use them.

In this snippet you will see how you can display the author avatar in the post display. Wordpress has a built in function

<?php echo get_avatar( $id_or_email, $size, $default, $alt ); ?>

You will use this to display the author avatar, by using the following snippet.

<?php echo get_avatar( get_the_author_email(), '128', '/images/no_images.jpg', get_the_author() ); ?>
Back to top ^

Join Paulund

  • Get access to 100s of premium tutorials and downloadable content
  • Members content consists of Premium WordPress plugins, CSS packages, jQuery packages, tutorial demo files and templates for 100s of web development tutorials
  • In-depth development tutorials
  • Priority tutorial requests
  • Priority email development support
  • No ads

Here at Paulund you'll find Web Development tutorials and snippets focusing mainly on PHP, WordPress and CSS. Members will get access to premium tutorials that go into more detail about development with these languages. You will also get access to downloadable premium content based on the tutorial.

Join Paulund

Leave a Reply

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