Codex tools: Log in / create account
Contents |
Retrieve the avatar for a user who provided a user ID or email address. Most commonly used in the comments section.
This function is also pluggable.
<?php echo get_avatar( $id_or_email, $size, $default, $alt ); ?>
$comment here, in order to display the gravatar of the commenter. In other templates within The Loop (for WordPress 2.7 and lower), you can use get_the_author_id() (deprecated in WordPress 2.8). For WordPress 2.8, please use get_the_author_meta('user_email').
<?php echo get_avatar( $comment, 32 ); ?>
get_avatar() is located in wp-includes/pluggable.php.