molongui_byline

Molongui » Help » Molongui Authorship Docs » Byline » molongui_byline

This shortcode allows you to display the post’s byline anywhere you want, not just below the post’s title, as most themes do.

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.

The byline can be customized making use of the optional attributes this shortcode can take.

The trivial shortcode to display a Molongui Byline looks like this:

Editor input

[molongui_byline]

Frontend output

As you can see, you get current post byline, showing the name of the author as a link to their archive page.

Examples

Post Byline with Custom Text

The shortcode below will display the names of the authors who wrote the article with ID=1 preceded by the “Written by” text:

Editor input

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam hendrerit ante ac libero imperdiet blandit.
[molongui_byline pid=1 before=’Written by ‘]
Phasellus venenatis neque non leo imperdiet pellentesque. Suspendisse varius magna velit, in blandit justo pharetra vel. Vivamus vitae arcu tortor.

Frontend output

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam hendrerit ante ac libero imperdiet blandit.
Written by James Worthy and Carol Turner
Phasellus venenatis neque non leo imperdiet pellentesque. Suspendisse varius magna velit, in blandit justo pharetra vel. Vivamus vitae arcu tortor.

Post Byline Without Links to Author Pages

You can also disable links to author pages, so plain text is displayed:

Editor input

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam hendrerit ante ac libero imperdiet blandit.
[molongui_byline pid=1 before=”Written by ” linked=no]
Phasellus venenatis neque non leo imperdiet pellentesque. Suspendisse varius magna velit, in blandit justo pharetra vel. Vivamus vitae arcu tortor.

Frontend output

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam hendrerit ante ac libero imperdiet blandit.
Written by James Worthy and Carol Turner
Phasellus venenatis neque non leo imperdiet pellentesque. Suspendisse varius magna velit, in blandit justo pharetra vel. Vivamus vitae arcu tortor.

Credit Authors of a Mentioned Post

It might also be interesting for you to credit the authors of a post you are mentioning:

Editor input

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam hendrerit ante ac libero imperdiet blandit.
Check out this amazing post written by [molongui_byline pid=1 linked=no]. You are gonna love it!
Phasellus venenatis neque non leo imperdiet pellentesque. Suspendisse varius magna velit, in blandit justo pharetra vel. Vivamus vitae arcu tortor.

Frontend output

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam hendrerit ante ac libero imperdiet blandit.
Check out this amazing post written by James Worthy and Carol Turner. You are gonna love it!
Phasellus venenatis neque non leo imperdiet pellentesque. Suspendisse varius magna velit, in blandit justo pharetra vel. Vivamus vitae arcu tortor.

Attributes

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

pidoptional
Post ID whose byline to display.
Accepts integer as post ID.
Defaults to current post ID.
Available since version 1.0.0.

separatoroptional
Delimiter that should appear between the authors.
Accepts plain text.
Defaults to comma.
Available since version 1.0.0.
last_separatoroptional
Delimiter that should appear between the last two authors.
Accepts plain text.
Defaults to and.
Available since version 1.0.0.
beforeoptional
Contents to add before author name(s).
Accepts plain text or HTML.
Available since version 1.0.0.
afteroptional
Contents to add after author name(s).
Accepts plain text or HTML.
Available since version 1.0.0.
linkedoptional
Whether to make author name(s) link to their author archive pages.
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