Shortcode to Display WordPress User Profile Picture or Avatar
To display users profile pictures or avatars, copy the shortcode shown below and paste it on any page, post, sidebars, widgets or wherever you want it to show.
[avatar]
You can also display users avatar together with a caption like so:
[avatar]Add caption here[/avatar]
The shortcode can accept the following attributes.
Attribute | Description |
---|---|
user | Can be a user ID, username, email address or slug. Also accepts current for currently logged-in users. |
size | The size of the image. E.g 150 . Also accepts original , large , medium or thumbnail . |
align | Can be left , right , center or none . Only works when avatar include a caption. |
link | URL the avatar will link to. Also accepts file to link to the image URL. |
target | Accepts _blank to open the link in new tab. |
Example: [avatar user="john" size="medium" link="file" align="center"]