Popular Authors includes two shortcodes that allow you to display the list of top authors and the top posts by author. If you’re unfamiliar with shortcodes, please read this article in the WordPress Codex.
[[wzpa_popular_authors]]
Use this shortcode to display the popular authors based on their number of visits tracked by Top 10. This shortcode takes multiple different attributes, which are all optional, as follows:
| Parameter | Type | Description |
|---|---|---|
| number | Integer | Maximum authors to return or display. Default: empty (all authors). |
| daily | Boolean | Whether to show daily or overall counts. Default: false. |
| daily_range | Integer / Null | The daily range for the custom period. Default: null. |
| hour_range | Integer / Null | The hour range for the custom period. Default: null. |
| offset | Integer | The number of authors to offset in retrieved results. Can be used in conjunction with pagination. Default: 0. |
| optioncount | Boolean | Show the count in parenthesis next to the author’s name. Default: true. |
| exclude_admin | Boolean | Whether to exclude the ‘admin’ account, if it exists. Default: false. |
| show_fullname | Boolean | Whether to show the author’s full name. Default: false. |
| show_avatar | Boolean | Whether to show the author’s avatar/thumbnail. Default: false. |
| hide_empty | Boolean | Whether to hide any authors with no posts. Default: true. |
| cache | Boolean | Whether to turn ON caching of the HTML output. Default: false. |
| include | Array / String | Array or comma/space-separated list of author IDs to include. Only authors belonging to the list will be displayed. Default: empty. |
| exclude | Array / String | Array or comma/space-separated list of author IDs to exclude. Default: empty. |
[[wzpa_author_top_posts]]
Use this shortcode to display the most popular posts for an author. This shortcode takes multiple different attributes, which are all optional, as follows:
| Parameter | Type | Description |
|---|---|---|
| author | Integer | Author ID to retrieve posts for. Default: 0 (all authors). |
| field | String | Field to filter authors by. Options: id, slug. Default: id. |
| posts_per_page | Integer | Number of posts to display per page. Default: 10. |
| post_type | String | Post type to retrieve. Default: post. |
| orderby | String | Field to sort posts by. Default: visits. |
| order | String | Sorting order. Options: ASC, DESC. Default: DESC. |
| daily | Boolean | Whether to retrieve daily counts or overall counts. Default: false. |
| disp_list_count | Boolean | Whether to display the count in a list format. Default: true. |
Top 10 shortcodes
Knowledge Base shortcodes
Contextual Related Posts shortcode