Shortcode: [show_avatar]

As of version 0.5 the plugin comes with a shortcode which can be used to show an avatar of any user using a userid or email address.

This is essentially only a wrapper for the get_avatar() template function.

Basic example: [show_avatar email=mail@address.com]

Available Parameters

email and id

The value specified in the id or email attribute is passed as the first parameter to the get_avatar() function.

Specify the email address of the user whose avatar you would like to display.

Example: [show_avatar email=mail@address.com]

avatar_size: The size of the avatar image

You can adjust the size of the avatar by specifying the avatar_size parameter.

Example: [show_avatar avatar_size=25]

align: The alignment of the avatar image

You can add an align attribute to display the avatar floated left/right or centered.

Possible values: left, right, center

Example: [show_avatar align=left]

Styling the show_avatar shortcode

Avatars shown using the show_avatar shortcode are wrapped into a div with the following classname: shortcode-show-avatar.

You can for example add the following bit of CSS code to your stylesheet to give the avatar an almost-white background and a grey border.

.shortcode-show-avatar {
  padding: 2px;
  background-color: #eee;
  border: 1px solid #ccc;
}
Follow

Get every new post delivered to your Inbox.

Join 547 other followers

%d bloggers like this: