Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Search bar breaking site when inserted in modal window
- This topic has 3 replies, 2 voices, and was last updated 9 years, 8 months ago by
Ernest Marcinko.
-
AuthorPosts
-
September 13, 2016 at 9:24 pm #10114
bosh
ParticipantHi!
We’re trying to integrate the ajax form in our theme’s main search. The search appears in a modal window when you click on the magnifying glass in the top-right corner.
If the Wp-Ajax-Search is enabled and the shortcode is being called in the modal, the page will not load at all. To try it out, navigate to: /wp-content/themes/companyofcars/partials/modals and remove the underscore before “searchform.php”. This will attempt to overwrite the parent theme (motors) search modal, but will break the site. Perhaps we’ve included the shortcode improperly in this file — I’m not sure!
We’ve tried turning off the preloader, but there still seems to be breaking errors on load without it.
Would love to see if you can get some insight into this! Thank you,
JoshuaSeptember 13, 2016 at 10:11 pm #10115Ernest Marcinko
KeymasterHi!
Thank you for the details, they helped me a lot!
I have found the problem. The quotes in the shortcode were invalid characters, probably generated when it was copy/pasted. I’ve corrected the code, plus I added a style for the old search to be hidden 🙂
—
I’ve also noticed that the search checkboxes were not working, because of a 3rd party theme script called jQuery uniform. It basically wraps up every checkbox and radio button on the page within a container for better styling – touching the search layout as well irresponsibly, causing it to malfunction and not to display them.
I had to make the following corrections in the wp-content\themes\motors\assets\js\app.js file on line 236, changed from:
[html]$(":checkbox,:radio").uniform({});[/html]
to:
[html]$(":checkbox,:radio").each(function(){
var parent = $(this).parent();
var i = 0;
while ( !parent.hasClass(‘wpdreams_asp_sc’) ) {
i++;
if ( i > 10 ) {
$(this).uniform({});
break;
}
parent = parent.parent();
}
});[/html]This change of course is not permanent, once the theme is updated it will disappear. I will try to come up with a better workaround for the upcoming release. I assume other theme developers are using this script as well for some reason, so I better look into it.
September 14, 2016 at 12:07 am #10116bosh
ParticipantHey! That’s brilliant. I really appreciate your prompt help.
Yes, I can deal with that javascript somehow — thanks for hunting down the issue.
I’ll leave a nice review on CodeCanyon. Cheers!
September 14, 2016 at 6:26 am #10117Ernest Marcinko
KeymasterYou cannot access this content.
-
AuthorPosts
- The topic ‘Search bar breaking site when inserted in modal window’ is closed to new replies.