Molongui Authorship

  1. Molongui
  2. >
  3. Docs
  4. >
  5. Molongui Authorship
  6. >
  7. Shortcodes
  8. >
  9. [molongui_author_avatar]

[molongui_author_avatar]

Applies only to the Premium version of the plugin, release 2.2.4 or higher.
Get premium version

This shortcode allows you to display the avatar of the current post author(s) 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

A trivial shortcode to display the author avatar looks like this:

Editor input

[molongui_author_avatar]

That would display the current post’s author(s) avatar as an image. Very useful in many cases. Check below the what the output would be:

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 3.1.9.
typeoptional
The type of author to display.
Accepts Accepts "user" or "guest".
Available since version 3.1.9.
sizeoptional
Size the displayed image must have.
Accepts Default WordPress image size ("thumbnail", "medium", "medium_large", "large" and "full") or height and width in pixels.
Available since version 3.1.9.
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 3.2.6.
Was this article helpful to you? Yes 1 No

How can we help?