Top 10 includes two shortcodes that allow you to display the count and the popular posts list. If you’re not familiar with shortcodes, please read this article in the WordPress Codex.

[tptn_views]

This will display the number of visits of the current post, page or custom post type. It takes one optional attribute:

  • daily: If set to 1, then the shortcode will return the number of daily views

[tptn_list]

This shortcode lets you insert the popular posts anywhere in your post content. It takes three main optional attributes:

  • limit: Maximum number of posts to return. The actual number displayed may be lower depending on the category / post exclusion settings.
  • heading: Set to 0 to disable the heading specified in Title of popular posts: under Output options
  • daily: If set to 1, then the shortcode will return the daily popular posts list

In addition to these attributes, the shortcode can take all the options as attributes and these can override the plugin settings. The following ones will affect the output of the popular posts list:

  • title_length: A numerical value to limit the length of the titles in the display
  • offset: A numerical value to indicate the number of posts to displace or pass over
  • post_types: Comma separated list of post types from which to select the top posts
  • daily_range and hour_range: Use either or both to override the default custom period range. hour_range accepts a number between 0 and 23
  • how_old: Number (in days) to only show posts that have been published within this range
  • thumb_width: Thumbnail width. Accepts a number
  • thumb_height: Thumbnail height. Accepts a number
  • show_author: Display the author of the post. 1 or 0
  • show_date: Display the published date of the post. 1 or 0
  • show_excerpt: Display the excerpt. 1 or 0
  • disp_list_count: Display the number of visits of the post
  • post_thumb_op: Location of the post thumbnail. Values include inline, after, text_only and thumbs_only
  • exclude_post_ids: Comma separated list of IDs to exclude
  • link_nofollow: Add nofollow attribute to links. 1 or 0
  • link_new_window: Add _blank attribute to links. 1 or 0
  • include_cat_ids: Comma separated list of term_taxonomy_id – this can be both categories and custom taxonomies