Here two screenshots of the problem.
Not active after i clicked the search icon:
https://prnt.sc/o7ch8j
Active after i clicked in the search bar:
https://prnt.sc/o7ci0k
The goal is that the search box is active immediately after clicking on the icon.
Hi,
Well, this requires a custom script for sure, to focus the search text field input after clicking that icon – since it is not part of the plugin itself.
Can you share a URL where I could take a look at this structure? Then I might be able to suggest a modification to make this work.
Best,
Ernest M.
Hey Ernest,
unfortunately I can not give you a url. this is a portal of a university that is only available as a student.
do you have another idea or can you help me otherwise? a codesnipped would theoretically be enough.
that would be great.
Thanks.
Chris
Hi Chris,
I’m afraid this is impossible without actually seeing the HTML structre. Otherwise I am not able to construct the snippet.
Best,
Ernest M.
Hey Ernest,
I can send you a url on thursday with access data.
Can you give me your emailadress? Thank you for your help.
Chris
Hi!
Got your message. Try adding this custom code to the functions.php in your theme/child theme directory. Before editing, please make sure to have a full site back-up just in case!
add_action('wp_footer', 'asl_custom_scrpt');
function asl_custom_scrpt() {
?>
<script>
jQuery(function($){
$('#menu-item-search').on('click', function(){
setTimeout(function(){
$('input.orig').get(0).focus();
}, 300);
});
});
</script>
<?php
}
This should do the trick. Make sure to clear all layers of cache as well, so the script is active.
Best,
Ernest M.
hey ernest,
That worked! Perfect! Many thanks for the quick support.
many Greetings
Chris
Great! I will mark this as resolved now. Feel free to rate the plugin if you like it.
Best,
Ernest M.