Hi @syce!
It seems that currently in the mobile version of your theme, the search engine in the header is not the FiboSearch. Please use below code snippet to launch our mobile overlay after clicking the search icon.
add_action( 'wp_footer', function() { ?>
<script type="text/javascript">
jQuery(document).ready(function($){
$('body').on('click', '.show-search', function(e){
if ($(window).width() < 992) {
e.preventDefault();
$('.dgwt-wcas-enable-mobile-form').click();
}
});
});
</script>
<style type="text/css">
.tbay-search-form {
display: none !important;
}
</style>
<?php }, 9999 );
You have two ways to add this code to your theme:
- Open the
functions.php in your child theme and add the code at the end.
- or install the Code Snippets plugin and apply this code as a snippet.
Regards,
Kris
Thread Starter
SyCe
(@syce)
Now it doesn’t work at all :-/ No more action when clicking the button, see http://www.suessigkeiten-shop.com
Hi @syce!
I improved the code. Now it should be working correctly.
add_action( 'wp_footer', function() { ?>
<script type="text/javascript">
jQuery(document).ready(function($){
$('body').on('click', '.show-search', function(e){
if ($(window).width() < 1199) {
e.preventDefault();
$('.dgwt-wcas-enable-mobile-form').click();
}
});
});
jQuery( document ).on( 'fibosearch/hide-mobile-overlay', () => {
$('.search-device').removeClass('open');
});
</script>
<style type="text/css">
.tbay-search-form {
display: none !important;
}
</style>
<?php }, 9999 );
Regards,
Kris
Thread Starter
SyCe
(@syce)
Hey 🙂
perfect! This works absolute fine. Thanks so much !!
Greetings from germany