Set random order for listings by default


I was searching for a solution to get a random order of listings in the searchresults and on tags/regions.

I stumbled upon this thread Change order of listings to random

		if(!is_admin() && 'hp_listing' === $query->get('post_type') && 'listings_view_page' === hivepress()->router->get_current_route_name()) {
			$query->set('orderby', 'rand');

But it seems like that this function is breaking the single listing-pages.

Usually it should look like this one: Ferien- & Pferdehof |

Any idea?

Okay, problem solved. Just saw your post here: Change order of listings to random

1 Like