Top Posts widget not working

  • Unknown's avatar

    I did a bunch of editing and changing of galleries this evening. Afterwards noticed my Top Posts and Pages widgets (which I call “Bestsellers”) decided to display only 5 posts, even though set for 10. I deleted and rewrote the widgets. I cleared my cache. I rebooted my computer and restarted Chrome. I double checked in Firefox and Safari. The widget still lists only the top 5 post, while the setting is for 10.

    (I use the widget twice. One is an image list to show only on front page. The other is a text list that shows on the other pages. Both are displaying only 5 posts, although set for 10.)

    The blog I need help with is: (visible only to logged in users)

  • Unknown's avatar

    Well, now the widgets are displayed 6 posts. Go figure. Maybe they’ll all come back by morning.

  • Unknown's avatar

    Or maybe not. Now it’s down to only 3 posts.

  • Hi @windwhistle,

    This is normal. If you have the widget set to views, it displays up to ten posts that received the most traffic in the past 48 hours, so the number of posts can fluctuate based on the amount of traffic in the past 48 hours.

    It also looks like the widget only recognises a post as “most viewed” if it hits a certain minimum number of views, so even if you’ve had views on more than 10 posts in the past two days, only posts that hit the minimum total will get pulled into the widget.

  • Unknown's avatar

    Hard to believe it’s normal when it never happened before. Ever. Not in all the years I’ve been on WP. What’s the minimum number for posts to get pulled into the widget?

  • Unknown's avatar

    Even if I had only 10 views in two days, those 10 would be the top 10 over 48 hours. If there’s now a minimum number of views set, it’s a change WordPress has made in the last day or two, and there’s no reason for it when the idea is to try to generate interest in other posts.

  • Based on the documentation and what I can see in the code, this is how the widget works, and I don’t see any recent changes. I use this widget on my site as well, and the number of posts shown has always fluctuated for me.

    I see it’s now showing nine posts on your site. I did some more digging and found a report from 2013 of the same happening. Based on that, the widget counts only the ten top items in stats for the past two days. If those ten included items excluded from the widget, including home and archive pages, it will display only the number of qualifying items from that top ten. So if your top ten includes 6 posts, 1 page, the home page, a category page, and an image attachment page, the widget will only show 7 items if you have it set to posts and pages only.

    So that would explain why it’s only showing 9 posts right now – the Home page views in your stats fall under the top 10. At this point I’m unable to check again if this might be related to why it only showed 3 yesterday, but if it drops that low again, let me know.

  • Unknown's avatar

    Did any of your checks involve using the code
    /?clearmemcache=brisket/ ?
    I found this in my stats yesterday under “Clicks” and have no idea what it is. I think the full link was
    http://piedtype.com/?clearmemcache=brisket/
    Or it might have been
    http://piedtype.wordpress.com/?clearmemcache=brisket/
    It’s not a link I would have set up because I don’t even know what it means.

  • Unknown's avatar

    Oh, and yes, I’ll let you know if the widget drops back to 3 again.

  • When I first checked your site I tried clearing our local cache for it in case a caching problem was preventing the widget from updating. That’s where that link comes from.

    That made no difference, which is when I started looking at the widget’s code to try and figure out exactly how it works.

  • Unknown's avatar

    Ah, okay. That was the only thing I could think of other than worrying about being hacked or something. Thanks for all your time. Looks like it’s working normally again.

  • Sorry if it caused some distress :)

  • The topic ‘Top Posts widget not working’ is closed to new replies.