Hi.
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
add_action(
'pre_get_posts',
function($query){
if(!is_admin() && 'hp_listing' === $query->get('post_type') && 'listings_view_page' === hivepress()->router->get_current_route_name()) {
$query->set('orderby', 'rand');
}
},
1000
);
But it seems like that this function is breaking the single listing-pages.
Usually it should look like this one: Ferien- & Pferdehof | Angelurlaub.de
Any idea?