molongui_author_bio

Molongui » Help » Molongui Authorship Docs » Shortcodes » molongui_author_bio

This shortcode allows you to display the biography of the current post author if no attributes are provided or the name 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 would be:

Editor input

[molongui_author_bio]

That would display the current post’s author bio as text. Nothing fancy but very useful in many cases. Check below what the output would look like:

Frontend output

Colleen Vance has been a staff writer since 2014. She has been with us since 1995, and, as a senior editor for many years, focussed on national security, international reporting, and features.

Should you like to retrieve the bio for a given author, let’s say a guest author whose ID is 123, you should use the shortcode like this:

Editor input

[molongui_author_bio id=123 type=guest]

And what if you’d like to retrieve the short bio for that author? Then you should use the shortcode like this:

Editor input

[molongui_author_bio id=123 type=guest length=short]

Attributes

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

idoptional
Author ID whose data you want to get.
Accepts integer as author ID.
Defaults to current post author ID.
Available since version 1.0.0.

typeoptional
The type of author.
Accepts Accepts “user” or “guest”.
Available since version 1.0.0.
lengthoptional
The bio text to retrieve.
Accepts “long” or “short”.
Defaults to full.
Available since version 1.1.17.

display_errorsoptional
Whether to display a message in case of error.
Accepts Accepts “yes” or “no”.
Defaults to yes.
Available since version 1.0.0.
Tip

You could also retrieve author bios using the molongui_author_meta shortcode providing either the “short_bio” or “long_bio” value to the “key” attribute.

Updated on February 26, 2022

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