Tagged: search field
Hi,
is it possible to display as soon as the page loads, the search field in the menu? By default, you must click on the magnifying glass logo to display it.
It is also not present in the code until you click on this logo.
His class is avia-search-tooltip if that can help.
Best regards,
Guillaume
Hey ae2agence44,
Thank you for the inquiry.
You can add this script in the functions.php file to automatically open the AJAX search on page load.
// custom scripts
function ava_custom_script_script()
{
?>
<script type="text/javascript">
(function($) {
// open search bar on load
$(document).ready(function() {
$('#top #menu-item-search a').trigger('click');
});
})(jQuery);
</script>
<?php
}
add_action( 'wp_footer', 'ava_custom_script_script', 9999 );
Please make sure to purge the cache and do a hard refresh before testing.
Best regards,
Ismael
Hi,
Thanks very much ! It works well.
Best regards.
Hi ae2agence44,
I’m glad that Ismael could help you :)
Thanks for using Enfold and have a great day!
Best regards,
Nikko