Categories
WordPress WordPress Templates

Useful WordPress Snippets: Gravatars

AUTHORS

To display author name as a link to the posts by that author:
<?php the_author_posts_link() ?>

To display author name, non-linked:
<?php the_author(); ?>

To GET an AVATAR for your author, sized to 96px by 96px
<?php echo get_avatar( get_the_author_meta('email'), '96' ); ?>

To GET an AVATAR for your author, wrapped in a link to the AUTHOR ARCHIVE:

  <a href="<?php echo get_author_posts_url(get_the_author_meta('ID')); ?>">
    <?php echo get_avatar(get_the_author_meta('email'), '96'); ?>
  </a>