Skip Navigation

[Resolved] in a view, with pagination & randomised sorting, each page re-randomises posts

This thread is resolved. Here is a description of the problem and solution.

Problem:

I have a view, and I elect to paginate & randomize found posts matching the filter.

When I go to the second page of results, the see the posts are re-randomized, and some of the posts which showed on the first page initially, now show on the second page.

Solution:

It is expected result, when you use pagination + random order, in each page, Views will query the database again, so you will get another random order again.

It is not recommended to use pagination + random order in same post view, you might consider to disable pagination or change the orderby parameter.

Relevant Documentation:

This support ticket is created 3 years, 3 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.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

This topic contains 2 replies, has 2 voices.

Last updated by brendaT-2 3 years, 3 months ago.

Assisted by: Luo Yang.

Author
Posts
#2311789

I am trying to:
I have a view, and I elect to paginate & randomise found posts matching the filter.
When I go to the second page of results, the see the posts are re-randomised, and some of the posts which showed on the first page initially, now show on the second page. Therefore I can never look thru all found posts as they jump across all of the pages. The randomise should only occur on the initial find posts, not on moving between the individual pages.

Link to a page where the issue can be seen:
You can see this happening on several of our pages, but here is one as an example: hidden link

I expected to see:
The found posts should stay in initial sort order (random) and allow the user to page up and down without re-randomising.

Instead, I got:
posts re-randomised for each page viewed.

#2311925

Hello,

It is expected result, when you use pagination + random order, in each page, Views will query the database again, so you will get another random order again.

It is not recommended to use pagination + random order in same post view, you might consider to disable pagination or change the orderby parameter.

#2311931

My issue is resolved now. Thank you!