Hi @betelguise!
Please try this code:
add_action( 'wp_footer', function() {
echo do_shortcode( '[fibosearch class="fibosearch-yolo-sofani" mobile_overlay="1" mobile_overlay_breakpoint="992"]' );
?>
<script type="text/javascript">
jQuery(document).ready(function($) {
$('.dialog-inner').append($('.fibosearch-yolo-sofani'));
$('body').on('click', '.icon-search-menu', function(e) {
e.preventDefault();
$('.js-dgwt-wcas-enable-mobile-form').trigger('click');
});
});
</script>
<style type="text/css">
#searchform {
display: none !important;
}
.fibosearch-yolo-sofani {
margin: 1em 0;
width: 70%;
position: absolute;
top: 40%;
left: 50%;
-webkit-transform: translate(-50%, -10%);
-ms-transform: translate(-50%, -10%);
transform: translate(-50%, -10%);
}
@media(max-width: 992px) {
#yolo_search_popup_wrapper {
display: none !important;
}
}
</style>
<?php
} );
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