molongui_author_avatar

Molongui » Help » Molongui Authorship Docs » Shortcodes » molongui_author_avatar

This shortcode allows you to display the avatar of the current post author if no attributes are provided or the avatar of a given author if you provide the author ID and author type.

It can be used anywhere within WordPress where shortcodes are supported. For most users, this will primarily be within the content of a WordPress post or page or the sidebar.

Example

The trivial shortcode to get the profile image of one of your authors would be:

Editor input

[molongui_author_avatar]

Frontend output

 

Attributes

Check out below all the available attributes this shortcode can take:

idoptional
Author ID whose name you want to be displayed.
Accepts integer as author ID.
Defaults to current post author ID.
Available since version 1.0.0.
typeoptional
The type of author to display.
Accepts Accepts “user” or “guest”.
Available since version 1.0.0.
sizeoptional
Size the displayed image must have.
Accepts Any registered image size (“thumbnail”, “medium”, “medium_large”, “large”, “full”…).
Available since version 1.0.0.
widthoptional
The width in pixels the avatar must have. If set, the “size” attribute is ignored
Accepts Integer.
Defaults to 150.
Available since version 1.1.8.
heightoptional
The height in pixels the avatar must have. If set, the “size” attribute is ignored
Accepts Integer.
Defaults to 150.
Available since version 1.1.8.
display_errorsoptional
Whether to display a message in case of error retrieving the author name
Accepts Accepts “yes” or “no”.
Defaults to yes.
Available since version 1.0.0.
Updated on February 26, 2022

Did not find a solution? We are here to help you succeed.
Open a support ticket