Hello,
Answering to your questions:
Q: How can i block executing a search if input field is empty?
A: If the plugin was configured to display the results only after the users type X characters into the input box (this is configured through the attribute: “Enter the minimum of characters number for start the search” in the settings page of the plugin) the plugin will not display the results if the input box is empty.
Q: How can I search only in specific pages?
A: The current version of the plugin search in the same elements that WordPress. The professional version of the plugin allow you restrict the elements to search by post_type, but if this behavior is not what you need, I can offer you a custom coding service form my private website:
https://wordpress.dwbooster.com/support
Best regards.
Thank you for the quick response.
I think the default wordpress search is conflicting with this plugin and even if none characters are entered, it still executes the search. Maybe I should remove it completely and configure this plugin.
Hello @halohtlo,
Could you send me the URL to your website for checking the issue in detail, please?
Best regards.
Hello @halohtlo,
If you are talking about hide the search results popup after delete the characters in the search box, please, follow the steps below (the modification will be included in the next update of the plugin)
1. Open the “/wp-content/plugins/search-in-place/js/codepeople_shearch_in_place.js” file with the text editor of your choice.
2. Go to the piece of code:
if(me.search.indexOf(v) != 0){
$('.search-in-place').hide();
}
and edit it as follows:
$('.search-in-place').hide();
3. Finally, clear the browser’s cache after edit the online file.
Best regards.
Hey, thanks for the help but I meant something else:
1. When you press search without any input, all the pages pop up in the middle of the front page.
2. When you search for something and it pops up, if you don’t click it but click on the search itself, all the pages pop up in the middle again.
Hello @halohtlo,
If you press the enter key with the focus in the search box, the control is taken by WordPress and it manage the search results page by itself (and WordPress loads by default all searchable items). For example, you can disable our plugin and press the enter key with the focus in the search box.
Best regards.