- Go to Admin - Plugins - Add New and search for "Better Postviews"
- Click on Install
- Click on Activate
- Download better-postviews.zip
- Unzip and upload the "better-postviews" folder to your "/wp-content/plugins/" directory
- Activate the plugin through the "Plugins" menu in WordPress
This plugin will work out-of-the-box - no configuration is necessary and there is no admin interface. However, it might be necessary to modify a few options (in the code) for a better experience.
- To disable tracking but retain the output, change "true" to "false" on line 13 of better-postviews.php
- To disable the post column view but retain tracking, change "true" to "false" on line 14 of better-postviews.php
- To enable a debug output in comments at the bottom of your sites source code, change "false" to "true" on line 15 of better-postviews.php
- To increase or decrease the transient lifetime of the top-one, top-three, and top-five data, change "300" on line 16 to a value of your choice
- To use the top-one, top-three, or top-five data elsewhere, simply call better_postviews::get_top_one(), better_postviews::get_top_three(), or better_postviews::get_top_five() and it will return an array of post IDs with element 0 being greatest - prepped and ready for your custom WP_Query!
- Will add get_top_five_count or something similar in the future.