Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › The search page is open at all times › Reply To: The search page is open at all times
April 30, 2020 at 12:46 pm
#27029
Keymaster
Hi Maria,
1. No, unfortunately that only works with the post or product elementor modules.
2. There is no option for that, but it is possible via custom code. I do not recommend that if it is avoidable, as random ordering performance can be very bad.
Try adding this custom code to the functions.php in your theme/child theme directory. Before editing, please make sure to have a full site back-up just in case!
add_filter( 'asp_query_args', 'asp_order_by_rand', 10, 1 );
function asp_order_by_rand($args) {
$args['cpt_query'] = array(
'fields' => '',
'join' => '',
'where' => '',
'orderby' => 'RAND(), '
);
return $args;
}