get_avatar ( $id_or_email, $size = 96, $default = '', $alt = '', $args = null )

  • (mixed) $id_or_email The Gravatar to retrieve. Accepts a user_id, gravatar md5 hash, user email, WP_User object, WP_Post object, or WP_Comment object.
  • (int) $size Optional. Height and width of the avatar image file in pixels. Default 96.
  • (string) $default Optional. URL for the default image or a default type. Accepts '404' (return a 404 instead of a default image), 'retro' (8bit), 'monsterid' (monster), 'wavatar' (cartoon face), 'indenticon' (the "quilt"), 'mystery', 'mm', or 'mysteryman' (The Oyster Man), 'blank' (transparent GIF), or 'gravatar_default' (the Gravatar logo). Default is the value of the 'avatar_default' option, with a fallback of 'mystery'.
  • (string) $alt Optional. Alternative text to use in <img> tag. Default empty.
  • (array) $args { Optional. Extra arguments to retrieve the avatar.
  • (false|string) `<img>` tag for the user's avatar. False on failure.
Defined at:
Change Log:
  • 4: .


Retrieve the avatar `` tag for a user, email address, MD5 hash, comment, or post.

Related Functions

get_avatar_url, get_avatar_data, get_metadata, get_tag, get_tags

Top Google Results

User discussions

wpseek mobile