Jetpack is a great plugin for collecting stats on your posts. But the only frontend display of that data they provide is the Top Pages and Posts widget. What if you want to filter that down to a more refined list?
BE Stats is the plugin for you. It asks for the 100 most popular posts over the past 30 days. I filter this list down to just posts and then store its ranking as post meta (‘be_stats’).
See it in use here: http://www.billerickson.net/popular/
You can then write custom queries using that metadata, or use the Display Posts Shortcode which makes it even easier.
Here’s some examples using the shortcode:
Lists the 10 most popular posts
[display-posts orderby="popular" posts_per_page="4"]
Lists the 4 most popular posts
[display-posts orderby="popular" posts_per_page="4" tag="basic"]
Lists the 4 most popular posts tagged “basic”
I developed this for a recent client project (still under development, will share link once it is live). The website is a news site that releases a lot of content. On the home and category archives they wanted to display recent posts and popular posts from that section. Here’s what I placed where I want popular posts:
There’s also some filters for you to customize how the plugin works.
be_stats_args – Controls what arguments are passed to WordPress.com Stats API. Example:
be_stats_update – Conditional for determining if stats data should be saved Examples:
Hopefully some other developers will find a use for this.