Reply To: Issue with default theme search replace

Home Forums Product Support Forums Ajax Search Pro for WordPress Support Issue with default theme search replace Reply To: Issue with default theme search replace


Ernest Marcinko

Hi Graeme,

Thank you for the proper details, I think I see what the problem is there.

I did a bit of investigation on how that menu search pop-up thing works in the site corner. It basically stores the while search in a link data attribute, and once the user clicks it, it copies it over to the actual DOM tree. This means that the search on document load is basically not present on the document, therefore the initializer script is not able to initialize it. This is a very bad practice, and I always discourage developers of doing this, as it virtually makes impossible to to replace the contents with anything interactive (javascript event driven).

In this case the lucky thing is that the pop-up script does not duplicate the elements, so after the first click everything stays as it is. This makes this issue resolvable, with a small custom code.

Add this custom code to the functions.php in your theme/child theme directory (copy from line 3 only!). Before editing, please make sure to have a full site back-up just in case!

This will add a small script to the page, which will re-initialize the search when the pop-up magnifier is clicked for the first time. Let me know if you need help with it!

Ernest Marcinko

If you like my products, don't forget to rate them on codecanyon :)