WordPress.org

Plugin Directory

Test out the new Plugin Directory and let us know what you think.

Top 10 - Popular posts plugin for WordPress

Track daily and total visits on your blog posts. Display the count as well as popular and trending posts.

If your question isn't listed here, please create a new post at the WordPress.org support forum. It is the fastest way to get support as I monitor the forums regularly. I also provide premium paid support via email.

How can I customise the output?

Several customization options are available via the Settings page in WordPress Admin. You can access this via Settings » Top 10

The main CSS classes include:

  • tptn_posts and tptn_posts_daily: Class of the main wrapper div. If you are displaying the related posts on non-singular pages, then you should style this

  • tptn_title: Class of the span tag for title of the post

  • tptn_excerpt: Class of the span tag for excerpt (if included)

  • tptn_thumb: Class of the post thumbnail img tag

  • tptn_list_count: Class of the span tag for post count in top posts list

  • tptn_counter: Class of the div tag that wraps the post count that is driven by the field "Format to display the count in: " under 'Output Options'

Shortcodes

[tptn_list]

lets you insert the popular posts anywhere in your post content. It takes three main optional attributes limit, heading and daily as follows:

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. To see the detailed list take a look at the function tptn_default_options() in top-10.php file

[tptn_views]

lets you display the number of visits. The plugin takes one optional attribute daily as follows:

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

Manual install

The below functions need to be added by editing your theme files where you wish to display them.

Display the post count with <?php if ( function_exists( 'echo_tptn_post_count' ) ) { echo_tptn_post_count(); } ?>

Display the overall most popular posts with <?php if ( function_exists( 'tptn_show_pop_posts' ) ) { tptn_show_pop_posts(); } ?>

Display the daily/custom period popular posts with <?php if ( function_exists( 'tptn_show_daily_pop_posts' ) ) { tptn_show_daily_pop_posts(); } ?>

You can also use the WordPress Widgets to display the popular posts in your sidebar / other widgetized areas of your theme

View examples of the plugin API to fetch the popular posts

Can this plugin replace Google Analytics?

No. Top 10 has been designed to only track the number of page-views on your blog posts and display the same. It isn't designed to replace Google Analytics or any other full fledged statistics application.

How does the scheduled maintenance work?

When you enabled the scheduled maintenance, Top 10 will create a cron job that will run at a predefined interval and clean up old entries from the wp_top_ten_daily table. Note: If you enable this option, WordPress will execute this job when it is scheduled the first time

How to make the columns on the Custom Post Type admin pages sortable?

Add the following code to your functions.php file of your theme.

add_filter( 'manage_edit-{$cpt}_sortable_columns', 'tptn_column_register_sortable' );

Replace {$cpt} by the slug of your custom post type. E.g. to make the columns on your 'projects' post type sortable, you will need to add:

add_filter( 'manage_edit-projects_sortable_columns', 'tptn_column_register_sortable' );

Requires: 4.1 or higher
Compatible up to: 4.7
Last Updated: 1 month ago
Active Installs: 30,000+

Ratings

4.6 out of 5 stars

Support

3 of 14 support threads in the last two months have been marked resolved.

Got something to say? Need help?

Compatibility

+
=
Not enough data

2 people say it works.
0 people say it's broken.

100,2,2 100,1,1 100,1,1
100,4,4 100,2,2
0,2,0 100,1,1 100,1,1 100,1,1
100,1,1
100,2,2
100,1,1
100,1,1
100,4,4
100,2,2
100,1,1
100,2,2 83,6,5 100,3,3 100,1,1
100,1,1 100,3,3 100,3,3
50,4,2 100,2,2
50,2,1
0,1,0 100,1,1 100,2,2
100,1,1 100,1,1 100,3,3
0,1,0
100,1,1 100,2,2
100,2,2 100,1,1 100,3,3 100,1,1 25,4,1 100,1,1
100,2,2 100,1,1
100,1,1 100,2,2 100,2,2 100,1,1
100,1,1
100,1,1 100,1,1
100,1,1
100,1,1
100,2,2 100,2,2
100,1,1 100,4,4 100,1,1
100,1,1
100,2,2 0,3,0 100,2,2 100,2,2 100,1,1
100,1,1 100,2,2
100,1,1
100,3,3
100,1,1
100,1,1
100,1,1 100,3,3
100,1,1
100,1,1
100,1,1 100,3,3
100,1,1
67,3,2
100,1,1 100,1,1
100,1,1
50,4,2 0,1,0 100,2,2