• Resolved ispreview

    (@ispreview)


    So I came across an unusual issue. I’m not sure exactly when it started occurring as it’s a part of the site that I don’t look at much.

    On post pages (single.php) I use this to pull the most popular 6 articles for the past week:

    <?php if (function_exists('wpp_get_mostpopular')) wpp_get_mostpopular("range=weekly&limit=6&order_by=views"); ?>

    Recently, I noticed that this wasn’t pulling the most popular articles, in fact it seemed to be pulling articles from a couple of weeks earlier. Which is odd since I use the same sort of code on my front page, where it works just fine.

    What I found is that if I use limit=4, limit=5 or limit=7 etc. then the output is correct, but for some reason if I use limit=6 then it outputs much earlier news. I can’t for the life of me figure out why it would be doing that. Obviously, for now at least, I’ve just decreased the output limit to 5.

    • This topic was modified 2 years, 6 months ago by ispreview. Reason: Small correction
    • This topic was modified 2 years, 6 months ago by ispreview.
Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Hector Cabrera

    (@hcabrera)

    Hi @ispreview,

    That sounds like a caching issue. Are you using the Data Cache feature?

    Plugin Author Hector Cabrera

    (@hcabrera)

    I re-read your comments and if the exact same code works fine on the homepage but displays different posts on single.php then it definitely must be caching related (not sure if it has to do with Data Caching as I suggested above though but it’s worth checking).

    Thread Starter ispreview

    (@ispreview)

    It’s not quite identical, the code on the front page has limit=4, while the one on single.php has limit=6. And yes I do use ‘Data Caching’, with a 1 hour clearance.

    Plugin Author Hector Cabrera

    (@hcabrera)

    Well, aside from using a different value with limit it is essentially the same code. The value number is irrelevant, the function doesn’t really care about it as long as it’s a positive integer.

    Since Data Sampling is set to 1 hour then your issue is very likely caused by something else. Try following the Troubleshooting instructions, hopefully that’ll give you some clues.

    Plugin Author Hector Cabrera

    (@hcabrera)

    As there hasn’t been a response from OP in two weeks I’ll mark this topic as resolved.

    OP if you still need help with this please leave a comment below.

    • This reply was modified 2 years, 6 months ago by Hector Cabrera. Reason: Fixed typo
    Thread Starter ispreview

    (@ispreview)

    I just left it on limit=6 instead, and haven’t had time to go back to try resolving the output for limit=4.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Unusual Issue with wpp_get_mostpopular’ is closed to new replies.