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

[molongui_byline]

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

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.

Example

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

Editor input

[molongui_byline]

That would display your current post’s byline, showing the name of the authors as a link to their archive page. Check below the what the output would be:

Frontend output

More Examples

Byline with custom text

The shortcode below will display the names of the authors who wrote this article 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.
Phasellus venenatis neque non leo imperdiet pellentesque. Suspendisse varius magna velit, in blandit justo pharetra vel. Vivamus vitae arcu tortor.

Byline without links to archive author pages

You can also disable links to archive pages, so plain text will be 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 Claire Williams and John Smith
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 Claire Williams and John Smith. 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 you can use to customize your byline:

pidoptional
Post ID whose author(s) will be displayed.
Accepts integer as post ID.
Defaults to current post ID.
Available since version 2.0.6.
separatoroptional
Delimiter that should appear between the authors.
Accepts plain text.
Defaults to comma.
Available since version 2.0.6.
last_separatoroptional
Delimiter that should appear between the last two authors.
Accepts plain text.
Defaults to and.
Available since version 2.0.6.
beforeoptional
Contents to add before author name(s).
Accepts plain text or HTML.
Available since version 2.0.6.
afteroptional
Contents to add after author name(s).
Accepts plain text or HTML.
Available since version 2.0.6.
linkedoptional
Whether to make author name(s) link to their author archive pages.
Defaults to yes.
Available since version 2.0.6.
Was this article helpful to you? Yes No

How can we help?