Following on the heels of Contextual Related Posts v2.1.0 from last week, I’ve released Top 10 – Popular Posts for WordPress v2.1.0 with several bug fixes and many new features. If you’re using this plugin and looking for support, please do not post a comment below, but instead create a new thread in the WordPress.org support forum or create a new issue in Github.
Fix blog_id 0 errors
Top v2.0 introduced a bug where in some cases, hits on some posts were recorded in the database with an ID of 0. Also new installs didn’t have their database properly set up for this. v2.1.0 fixes both these issues. Additionally, I’ve added a new button at the bottom of the Settings page titled “Merge blog ID 0 and 1 post counts” which will convert all recorded posts with a blog ID of 0 to 1. The counts will be summed up and not replaced so you won’t lose the correctly recorded counts.
Bye bye Timthumb
Timthumb is completed deprecated from this version. It’s no longer bundled with the plugin. If you’d like to continue using timthumb, you’ll need to host it yourself and hook it into Top 10.
If you’re looking for a replacement to timthumb, do check out OTF Regenerate Thumbnails. It’s designed to regenerate images on the fly!
Custom Post Types in the Widget
You can now choose which post types to display in the widget. This will allow you to selectively choose top posts by custom post type. e.g. if you’re running a site with reviews which are registered as a separate post type, then you will be able to display the top visited reviews on your site.
I’ve introduced this new function that will allow you to fetch the new posts as an object (or alternatively as an array).
<?php get_tptn_pop_posts(); ?> and you’re set to go. The function allows you to pass an amazingly huge set of arguments, i.e. everything that is available under tptn_default_options()
Are you using Top 10?
If you’ve been using Top 10, do consider writing a good review of the plugin on the WordPress.org. This will encourage more users to try the plugin. Additionally, if you can, do consider a donation. Currently, that’s the only income that this plugin generates.
Complete list of changes in Top 10 – Popular Posts for WordPress v2.1.0:
- New: Button in Top 10 settings page to merge posts across blog ID 0 and 1
- New: Function & filter
get_tptn_pop_poststhat can be used to fetch the popular posts as an object or array. Perfect if you want to write custom code in your theme
- New: Support for WPML to return the correct language ID. Thanks to Tony Flags’ code snippet.
- New: Filter
tptn_list_countto modify the formatted list count. See a working example
- New: Post types can now be selected in the widget. This allows you to select top posts by post type
- Modified: Plugin will attempt to pull the correct size image when fetching the first image in a post
- Modified: Deprecated “Always display latest post count in the daily lists”
- Modified: timthumb has been deprecated. The script is no longer packaged within Top 10
- Fixed: Bug in tracking code when not using Ajax
- Fixed: Bug in admin column did not check for the blog_id
- Fixed: Bug where default thumbnail location was not correctly saved
- Fixed: Incorrect thumbnail was pulled on attachment pages
- Fixed: blog_id column of the database is correctly initialised as