• Resolved Kaycin

    (@kaycin)


    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!

    https://wordpress.org/plugins/jetpack/

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Jeremy Herve

    (@jeherve)

    Jetpack Mechanic 🚀

    Could you update to the most recent version of Jetpack, and see if it helps? We’ve made changes to the way Top Posts were pulled in the past few releases, and this may help you.

    Let me know how it goes.

    Thread Starter Kaycin

    (@kaycin)

    That worked!! Thanks so much. Last question: is there a way to embed the top post feature instead of having it as a widget on a side bar? I’d like to have the top posts featured on the page.

    Thanks again!

    Thread Starter Kaycin

    (@kaycin)

    Check that! I figured it out: http://www.nickblakeslee.com/?page_id=1022

    using this code:
    [jetpack_top_posts_widget types="post" count="10" display="list"]

    Is there a way to have it say ‘Top Posts’ instead of ‘Top Posts & Pages’? Or even get rid of ‘Top Posts & Pages’ all together since the redundancy of the page suggests it’s already Top posts.

    Plugin Author Jeremy Herve

    (@jeherve)

    Jetpack Mechanic 🚀

    You can use the title parameter to specify a custom title.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Top posts beyond 48 hours’ is closed to new replies.