Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Compact Box Layout not loading correct sometimes › Reply To: Compact Box Layout not loading correct sometimes
November 16, 2023 at 11:14 am
#46054
Keymaster
All right – I tried to replicate the issue a few times on different devices yesterday but I couldn’t, so I don’t know where it originated from unfortunately.
Well, for the results page you could try a custom code for that:
add_filter("asp_query_args", "asp_query_args_remove_variation", 10, 2);
function asp_query_args_remove_variation($args, $search_id) {
if ( !$args['_ajax_search'] ) {
$args['post_type'] = array_diff($args['post_type'], array('product_variation'));
}
return $args;
}
Try adding this code via the Code Snippets plugin or to the functions.php file in your theme/child theme directory – make sure to have a full server back-up first for safety. For more details you can check the safe coding guidelines.