Tell us what you are trying to do? I'm trying to display random posts in a side bar. I'd like to show just one at a time and allow Toolset to show a new random post every x second. However, I believe there is an issue with Pagination and Random posts...the problem is that the posts ALL start with the same posts and the ordering doesn't seem to be random.
It appears the pagination is the issue
"Pagination combined with random ordering can lead to same items appearing in more than one pages. It's recommended not to combine pagination with random ordering, unless unexpected results are acceptable."
Is there anyway to create a view that will cycle through and display a series of random posts?
What is the link to your site? hidden link
You'll have to look at several of these...you'll see the WP Views widget in the sidebar.
As the warning notes, you can have unexpected results combining pagination with random results.
The reason being every time you paginate you perform a new query, and the new query doesn't know what results were already shown on previous pages, and so the same results can be shown again.
Imagine you had a "query" that returned all the letters of the alphabet in random order.
On page one that might show just the first letter of the results "HEISBTQA....", i.e. "H".
Page two might show the second letter from results of a new query "PRWUBVDSA....", i.e. "R"
Page three might show the third letter from results of a new query "OEHNMGIXZ...", i.e. "H"
The problem is likely to be more noticeable when working with small result sets.
Now, in your View settings if the options to preload prev and next pages and cache results are used then it can appear to be stuck showing just the same few results and cycling over them (including possible repetitions).
So for the best results, bearing in mind that you could still see some results repeated, disable the options to load prev and next pages and cache pages.
The topic ‘[Closed] Random posts’ is closed to new replies.