Skip Navigation

[Closed] Pagination not working on random ordering

This support ticket is created 2 years, 9 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

This topic contains 1 reply, has 2 voices.

Last updated by Nigel 2 years, 9 months ago.

Author
Posts
#2367835

I have a paginated view, currently with 10 items per page/3 pages. But if I set the order to 'random', it's just random on each page. It should randomize the complete listing of posts, and then paginate that. So that if the user goes from page 1 to 2, then back again, it should be as it had been. And currently, an item from page 1 might appear again on page 2, etc. How can I resolve this?

#2368077

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

That's not possible. Each time you go to a new page of results it submits a new query (e.g. give me results 21-30), and with random ordering that can return any 10 posts, and that may include ones that have been returned in prior pages of results.

(There is a note in the UI warning that this occurs.)

It's how WordPress queries work.

If you had 5000 posts pagination allows you to return and retain in memory only, say, 10 posts at a time, rather than all 5000.

But it does make pagination and random ordering incompatible.

The topic ‘[Closed] Pagination not working on random ordering’ is closed to new replies.