Hello, we have set ordering to Random but it's not working hidden link
Also if it is set to random ordering is it meant to random order on pages that have been filtered. For example if I filter by a location, that new list of results, should be in a random order?
Thanks
On my own site random ordering works correctly. To see why it is not working on your site, I would want to enable the Views debug mode, so that I can see the actual query being performed when visiting that page. But I need to be logged-in as an administrator to see the resulting pop-up, so let me set a private reply to get credentials from you.
You should not mix random results with pagination (the classic editor has a warning about this, but it is missing from the block editor). Every time you fetch a new page of results, that is a new database query, which if ordered randomly may include posts that have already been shown on previous pages.
There seems to be a problem with your server, and I think you will need to consult with your hosting company to identify the problem.
The View generates a database query via the WordPress WP_Query class, which creates the actual SQL query. Checking, I can see that the SQL query is correctly formed, including the option to ORDER BY RAND(). But the results are returned ordered by post ID.
I added a plugin (WP Data Access) where you can run database queries directly to demonstrate the problem.
When I run the following simple query, it returns the results ordered by post ID, and not in a random order.
SELECT wp_posts.ID
FROM wp_posts
WHERE wp_posts.post_type = 'company'
AND wp_posts.post_status = 'publish'
ORDER BY RAND()
If the database is returning the results in the wrong order, there's not much we can do about it.
I did a quick Google to see if some server settings were required for random ordering but didn't find anything, and it would be best if you asked your host.
You can show them the results of the above query with the plugin I installed.
Go to WP Data Access > Query Builder, paste in the above query, and Execute.