[Support request] random posts order with ajax pagination

Please login to receive premium support.

Support for the free plugin can be found here.

Home Forums Pro Support random posts order with ajax pagination

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #27040
    Davide
    Participant

    Hi, is there a way to show the posts randomly using the ajax pagination?

    Right now they are loaded randomly..but every time is the same random order.

    Am I missing something?

    thanks!
    Davide

    • This topic was modified 2 months, 3 weeks ago by Davide.
    #27110
    elvin
    Moderator

    Hi there,

    This is quite tricky to address as there are multiple things that may be preventing “true random” order every time you refresh the page.

    And it’s actually not recommended in the long run when the number of posts increases.

    This is a good read explaining why:
    https://wpengine.com/support/about-order-by-rand/

    • This reply was modified 2 months, 2 weeks ago by elvin.
    #27351
    Davide
    Participant

    Hi Elvin,
    thank you for your answer. It makes sense.

    …but what do you mean by that:

    This is quite tricky to address as there are multiple things that may be preventing “true random” order every time you refresh the page.

    Is the “true random” supposed to work or not? (I tested with two different sites, and on both of them no “true random”.

    Anyway, I also noticed that with the carousel option active the “true random” is working (I guess because the number of loaded post is defined / limited).

    Is there a way to have an “hybrid” version of that? Display a limited number of posts (like with the carousel), with “true random” and ajax pagination but in a “normal” view?

    Thank you

    Davide

    #27453
    Tom
    Keymaster

    “True random” is very difficult to achieve in programming.

    The orderby rand option works quite well, but not when it comes to pagination. That’s when you need to implement a “seed”, which WPSP doesn’t do: https://wordpress.stackexchange.com/questions/31647/is-it-possible-to-paginate-posts-correctly-that-are-random-ordered

    While it’s possible with some filters, it’s not something I personally have a ton of experience with, unfortunately.

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.