Change order of listings to random

Hello,

I would like to set the order of listing to random in “Services“ page. But it seems that the solution provided in the past by @yevhen ( Change order of listings to random ) is not working currently. I am using TaskHive Theme. For randomize listings order in the search results and categories, I have uset the solution provided in this topic and it’s working. Randomize listings order and pages - #3 by Creo .

Currently my issue is just related to the “Services“ page where the the listings are not displayed random.

It is there any solution?

Thank you in advance!

Hi,

If you’re familiar with coding basics, you can try customizing the linked snippet to change the condition, for example to include the is_page() && get_queried_object_id()===123 where 123 is the Services (listings) page ID. Currently the condition includes only is_post_type_archive condition and it doesn’t cover the page itself.

We’ll also add a dedicated hook for customizing the listings query in the next update.

Hope this helps