Top posts beyond 48 hours
-
Hi there!
I recently discovered Jetpacks’ top posts feature. That said, the default is top posts from the last 48 hours, which is great for high traffic blogs and frequent posts, but not so great for hobby writers who don’t get to post all the time.
I found a guide on the hook of the month to increase the time from 2 days.
https://jetpack.com/2016/01/12/hooks-customize-top-posts-pages-widget/
In the post, Jeremy shows us how to set it to 30.
I want Jetpack to show the top posts all time, using the data it’s received over the last year. Jeremy states setting the value to -1 would do unlimited. When I set it to ‘-1’ nothing shows up, so I tried entering the days manually; 3 years.
Here’s how I currently have it setup:
function jetpackme_top_posts_timeframe() { return '1050'; } add_filter( 'jetpack_top_posts_days', 'jetpackme_top_posts_timeframe' );Meaning it should parse data from the past three years and show the top posts from three years (showing at least 10 posts, as that’s the maximum the widget will show). Still, it only shows 3, from the last few months.
Yet when I look back on my jetpack data, I see there are several posts from earlier that that have many more views.
I’m using the snippet Widget and simply adding the code that Jeremy talked about in his guide.
Am I doing something wrong? If you go to my blog, you can see for yourself that only 3 posts are showing up. One of which only has ~7 views counted on Jetpack, while a 400 view post is completely ignored.
Any pointers?
Thanks for the help!
The topic ‘Top posts beyond 48 hours’ is closed to new replies.