WordPress.org

Ready to get started?Download WordPress

Plugin Directory

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 in the WordPress.org support forum. I monitor the forums on an ongoing basis. If you're looking for more advanced paid support, please see details here.

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 plugin also provides you with a set of CSS classes that allow you to style your posts by adding code to the style.css sheet. In a future version, I will be adding in CSS support within the plugins Settings page.

The following CSS classes / IDs are available:

  • tptn_related: ID of the main wrapper div. This is only displayed on singular pages, i.e. post, page and attachment

  • tptn_related: 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'

For more information, please visit http://ajaydsouza.com/wordpress/plugins/top-10/

Shortcodes

You can insert the popular posts anywhere in your post using the [tptn_list] shortcode. The plugin takes three optional attributes limit, heading and daily as follows:

[tptn_list limit="5" heading="1" daily="0"]

limit : Maximum number of posts to return. The actual number displayed may be lower depending on the category / post exclusion settings.

heading : By default, the heading you specify in Title of popular posts: under Output options will be displayed. You can override this by specifying your own heading e.g.

<h3>Top posts</h3>
[tptn_list limit="2" heading="0"]

daily : If set to 1, then the shortcode will return the daily popular posts list

You can also display the number of visits using the [tptn_views] shortcode. The plugin takes one optional attribute daily as follows:

[tptn_views daily="0"]

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

Filters

The plugin includes the following filters that allows you to customise the output for several section using add_filter.

tptn_heading_title : Filter for heading title of the posts. This is the text that you enter under Output options > Title of related posts

tptn_title : Filter for the post title for each of the related posts

I'll be adding more filters eventually. If you are looking for any particular filter do raise a post in the support forum requesting the same.

How does the plugin select thumbnails?

The plugin selects thumbnails in the following order:

  1. Post Thumbnail image: The image that you can set while editing your post in WordPress » New Post screen

  2. Post meta field: This is the meta field value you can use when editing your post. The default is post-image

  3. First image in the post: The plugin will try to fetch the first image in the post

  4. Video Thumbnails: Meta field set by Video Thumbnails

  5. Default Thumbnail: If enabled, it will use the default thumbnail that you specify in the Settings screen

The plugin uses timthumb to generate thumbnails by default. Depending on the configuration of your webhost you might run into certain problems. Please check out the timthumb troubleshooting page regarding permission settings for the folder and files.

Manual install

You may choose to not display the post count automatically. If you do so, then in order to display the post count, you will need to add <?php if(function_exists('echo_tptn_post_count')) echo_tptn_post_count(); ?>.

In order to display the most popular posts, you will need to add <?php if(function_exists('tptn_show_pop_posts')) tptn_show_pop_posts(); ?>.

In order to display the most popular posts, you will need to add <?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.

Can this plugin replace Google Analytics?

Never. This plugin is designed to only track the number of pageviews on your blog posts and display the same. It cannot replace Google Analytics or any other full fledged statistics application.

How does the scheduled maintenance work maintenance work?

When you enabled the scheduled maintenance, Top 10 will create a cron job that will run at a predefined interval and truncate 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 Posts 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: 3.3 or higher
Compatible up to: 4.0
Last Updated: 2014-5-22
Downloads: 163,350

Ratings

4 stars
4.4 out of 5 stars

Support

10 of 19 support threads in the last two months have been resolved.

Got something to say? Need help?

Compatibility

+
=
Not enough data

3 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,3,3 100,1,1