molongui_author_posts

Molongui » Help » Molongui Authorship Docs » Shortcodes » molongui_author_posts

This shortcode allows you to easily display anywhere you want a list of (all) posts by author.

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.

Different layouts are available, so you can list posts as:

Dev Tip

None of the available layouts suit your needs? Check this article out on how to provide your own custom template to display the posts list.

That posts list can be customized making use of the optional attributes this shortcode can take.

Example

Editor input

[molongui_author_posts]

Frontend output

As you can see, you get a nice list of posts showing post title, featured image and byline.

What if you had a lot of posts to list and you wanted to display just, let’s say, 2 per page? You have a convenient argument for that: paginate

Editor input

[molongui_author_posts paginate=2]

Frontend output

You can easily change how the list to display will look like by choosing from available layouts – “plain”, “flat”, “thumbs”, “cards” or “preview”. Let’s say you want to display the list using the “plain” layout. You should use the shortcode like below:

Editor input

[molongui_author_posts layout=plain]

Frontend output

That might be quite an austere way to display your posts. So let’s check how they would look using the “thumbs” layout:

Editor input

[molongui_author_posts layout=thumbs]

Frontend output

And what about the “cards” layout?

Editor input

[molongui_author_posts layout=cards]

Frontend output

Finally, let’s say you want to display your posts like you might find them on any blog around. You can use the “preview” layout for that. Check below:

Editor input

[molongui_author_posts layout=preview]

Frontend output

Regardless of the layout you choose to display your posts, you can even customize it a little bit further using some of the available optional attributes. Take a look below!

Attributes

Check out below all the available attributes you can use to fully customize the displayed posts list:

authoroptional
Author ID. If none given, assigned main author to the current post is taken.
Accepts An integer being a User or Guest Author ID.
Available since version 1.0.0.
guestoptional
Whether the author of the posts to list is a guest author.
Accepts “yes” or “no”.
Defaults to no.
Available since version 1.0.0.
layoutoptional
Layout used to display the list of posts.
Accepts “plain”, “flat”, “thumbs”, “cards” and “preview”.
Defaults to flat.
Available since version 1.0.0.
post_typesoptional
Post type to list.
Accepts “post”, “page”, “all”, “selected” and “related”.
Defaults to selected.
Available since version 1.0.0.
categoryoptional
Category ID or comma-separated list of IDs.
Accepts Comma separated IDs.
Available since version 1.0.1.
include_postsoptional
Post IDs to list.
Accepts Comma separated post IDs.
Available since version 1.0.0.
exclude_postsoptional
Post IDs to exclude from being listed.
Accepts Comma separated post IDs.
Available since version 1.0.0.
countoptional
Max number of posts to list.
Accepts Integer.
Available since version 1.0.0.
paginateoptional
Number of posts to list per page. If total posts to list is bigger than this value, the list gets pagination
Accepts Integer.
Available since version 1.1.10.
orderoptional
Designates the ascending or descending order of the “orderby” parameter.
Accepts “asc” or “desc”.
Defaults to asc.
Available since version 1.0.0.
orderbyoptional
Sort retrieved authors by parameter.
Accepts “name”, “date”, “title”, “modified” or “rand.
Defaults to date.
Available since version 1.0.0.
classoptional
CSS class to add to the containing the list.
Accepts CSS class names separated by spaces.
Available since version 1.0.0.
list_iconoptional
The icon to display before the post title on the plain layout template.
Accepts “feather”, “doc”, “list”, “user”, “info”, “at”, “checkmark”, “ok”, “cancel”, “plus”, “minus”, “star”, “heart”, “notice”, “tip” or “none”.
Defaults to feather.
Available since version 1.0.0.
list_divideroptional
Whether to add a dividing line between listed posts. Applies only to “plain” and “flat” layouts.
Accepts “yes” or “no”.
Defaults to no.
Available since version 1.0.0.
link_coloroptional
Post title color.
Accepts Accepts CSS color values.
Available since version 1.0.0.
link_decorationoptional
Post title text decoration.
Accepts CSS text-decoration property values.
Available since version 1.0.0.
show_dateoptional
Whether to display post date on posts list when using “flat”, “thumbs”, “cards” or “preview” layouts.
Defaults to yes.
Available since version 1.0.0.
show_bylineoptional
Whether to display post byline on posts list when using “flat”, “thumbs”, “cards” or “preview” layouts.
Accepts “yes” or “no”.
Defaults to yes.
Available since version 1.0.0.
show_excerptoptional
Whether to display post excerpt on posts list when using “cards” or “preview” layouts.
Accepts “yes” or “no”.
Defaults to yes.
Available since version 1.0.0.
excerpt_lengthoptional
Number of words to display as post excerpt on posts list when using “cards” or “preview” layouts.
Accepts integer.
Defaults to 25.
Available since version 1.0.6.
meta_keyoptional
You can filter the posts retrieved by this shortcode by specifing any meta_key name existing on your installation.
Available since version 1.0.0.
meta_valueoptional
The value the specified meta_key should have in order to retrieve the post. This value is mandatory if “meta_key” attribute is being used.
Available since version 1.0.0.

Deprecated Attributes

Listed attributes below were available on previous versions of the plugin, but have been removed or replaced:

max_postsoptional
Max post count to list.
Accepted integer.
Was available from version 2.0.10 to 3.2.28.
Replaced by post_count.
post_countoptional
Max post count to list
Accepted integer.
Was available from version 1.0.0 to 1.0.10.
Replaced by paginate.
list_classoptional
CSS class to add to the list
container
Accepted string.
Was available from version 2.0.10 to 3.2.28.
Replaced by class.
Updated on April 27, 2023

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