Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Search and results problems › Reply To: Search and results problems
January 23, 2019 at 1:12 pm
#20930
Keymaster
Hi,
Thank you for your kind words!
1. It is intended behavior, there is no option for that unfortunately. However using a custom code it might be possible. 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_action('wp_footer', 'asp_show_default_results_on_empty');
function asp_show_default_results_on_empty() {
?>
<script>
jQuery(function($){
$('.proclose svg').on('click', function(){
var $s = $(this).closest('.asp_m');
var id = $s.data('id');
var inst = $s.data('instance');
if ( $s.find('input.orig').val() != '' )
setTimeout(function(){
ASP.api(id, inst, 'searchFor', '');
}, 300);
});
});
</script>
<?php
}
2. Make sure to select these custom fields for search, that should solve the issue.