I have a view that displays related custom posts for the given product.
The problem is that some of the displayed customs posts are being displayed mutliple times.
You can see here the sample - hidden link
Below you will find double displayed i.e.:
- Projekt pokoju dla dziewczynki, Jagody (4 lata) (#492)
- Projekt pokoju dla dziewczynki, Wiktorii (1 rok) (#686)
etc
I have double checked the relation in my Products and the related custom posts are connected properly - only one time.
I have also disabled Litespeed cache plugin - nothing helps.
The View that displays the related posts uses pagination (infinite scrolling) with random sorting order.
These will lead to unpredictable results. When the second page of results is retrieved and random ordering is used then *any* results can be included in the new page of results, including ones that have been previously shown. Because the View is set to use infinite scrolling (so that new pages of results are appended to the existing results rather than replacing them) you can see the same posts appearing multiple times.
Ok, thank you for the detailed explanation.
For me it sounds like a bug in toolset implementation. I'm seeing first time that such combination of infinite scrolling and random order producing this weird results. Any plans to fix it?
What do you propose as a workaround for it? I want to keep the random order of related results.
It's certainly not a bug, it is a logical conclusion of using random ordering with pagination.
It could only work differently if the pagination were "fake" pagination, where, instead of querying a sub-set of results from the database for each paged update, the entire set of results were shipped to the browser, which then selectively showed some results while hiding others.
It could be done, but would be an awful solution on sites where there were many results to paginate.
A custom app might implement things differently, but Toolset is built for WordPress, and this is an inevitable result of how pagination works in WordPress.