Popular Authors registers two shortcodes that let you embed the most-popular authors list and a list of top posts for a given author anywhere in your content. Visit counts are drawn from Top 10.

If you are unfamiliar with shortcodes, read the Shortcode entry in the WordPress CodexOpens in a new window.

Use this shortcode to display the popular authors based on the number of visits tracked by Top 10.

[wzpa_popular_authors number="5" show_avatar="1"]

All attributes are optional. Attributes that are not set fall back to the defaults configured under Top 10 → Settings → Popular Authors.

ParameterTypeDescription
numberIntegerMaximum authors to return. Default empty (uses the wzpa_number setting, which defaults to -1 / all authors).
dailyBooleanDisplay daily or overall counts. Default false.
daily_rangeIntegerNumber of days in the custom period. Default null.
hour_rangeIntegerNumber of hours in the custom period. Default null.
offsetIntegerNumber of authors to skip from the top. Use with pagination. Default 0.
optioncountBooleanShow the visit count next to the author’s name. Default true.
show_postcountBooleanShow the post count next to the author’s name. Default false.
exclude_adminBooleanExclude the admin user. Default false.
show_fullnameBooleanShow the author’s first and last name instead of their display name. Default false.
show_avatarBooleanDisplay the author’s avatar. Default false.
hide_emptyBooleanHide authors with no published posts. Default true.
cacheBooleanCache the HTML output using Top 10’s cache settings. Default true.
includeArray / StringComma- or space-separated list of author IDs to include. Overrides exclude. Default empty.
excludeArray / StringComma- or space-separated list of author IDs to exclude. Default empty.
post_typeStringComma-separated list of post types to include. Default post.
stylesStringStyle key: no_style, card, or left_thumbs. Default uses the wzpa_styles setting.
before_listStringHTML before the list. Default <ul>.
after_listStringHTML after the list. Default </ul>.
before_list_itemStringHTML before each list item. Default <li>.
after_list_itemStringHTML after each list item. Default </li>.

[wzpa_author_top_posts]

Use this shortcode to display the most popular posts for a specific author. The shortcode calls wzpa_display_top_posts_by_author() under the hood.

[wzpa_author_top_posts author="42" posts_per_page="5"]

The author attribute is required. All other attributes are optional.

ParameterTypeDescription
authorInteger / StringAuthor value. With field="id", an integer user ID. With field="slug", the user nicename. Default 0 (returns nothing).
fieldStringField to look up the author by. Accepts id, slug, email, or login. Default id.
posts_per_pageIntegerNumber of posts to display. Default 10.
post_typeStringPost type to retrieve. Default post.
orderbyStringField to sort by. Default visits.
orderStringSorting direction. Accepts ASC or DESC. Default DESC.
dailyBooleanRetrieve daily counts instead of overall counts. Default false.
disp_list_countBooleanDisplay the count in parentheses. Default true.

Was this article helpful?