Table of Contents[Hide][Show]
Our Mai Avatar shortcode allows you to display a post author’s avatar in your header or footer meta, inside your content, template parts, or anywhere shortcodes can be used.
The example below adds the [mai_avatar]
shortcode to the Header Meta text field in Customizer > Theme Settings > Single Content > Post.
Here are the available parameters to custom your avatar display.
id
The id parameter defaults to "current"
and also accepts a user ID.
Examples:
[mai_avatar
]
This is the same as the first example:
[mai_avatar id="current"
]
This displays an avatar for the user with an id of 1234:
[mai_menu id="1234"
]
size
The size to display the avatar. Accepts any unit value (px, em, rem, %, etc).
Examples:
[mai_avatar size="40px"
]
display
Accepts any CSS display property. This is typically not used.
Examples:
[mai_avatar display="inline"
]
margin_top
Adds top margin to the avatar. Accepts any unit value (px, em, rem, %, etc).
margin_bottom
Adds bottom margin to the avatar. Accepts any unit value (px, em, rem, %, etc).
margin_left
Adds left margin to the avatar. Accepts any unit value (px, em, rem, %, etc).
margin_right
Adds right margin to the avatar. Accepts any unit value (px, em, rem, %, etc).