Skip to content

Instantly share code, notes, and snippets.

@someguy9
Created August 4, 2022 14:45
Show Gist options
  • Save someguy9/5af4a224d1256205b0c9201a9c615ebd to your computer and use it in GitHub Desktop.
Save someguy9/5af4a224d1256205b0c9201a9c615ebd to your computer and use it in GitHub Desktop.
Show the author avatar of the current WordPress post.
<?php
// Display current post's author avatar (includes <img> tag)
echo get_avatar( get_the_author_meta( 'ID' ), 96 );
// Display current post's author avatar URL
echo get_avatar_url( get_the_author_meta( 'ID' ), array( 'size' => 96 ) );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment