This website uses cookies to personalize your experience. By using this website you agree to our cookie policy.

Reply To: Typing with one click

#30685
Ernest MarcinkoErnest Marcinko
Keymaster

Hi Patrick,

Well, that needs to be custom coded, so that the menu click triggers a focus on the input. Some search menu icons have that pre-programmed, for others a small code is needed. This one should cover your case:

add_action('wp_footer', 'asp_add_menu_focus_trigger');
function asp_add_menu_focus_trigger() {
  ?>
  <script>
	jQuery(function($){
		$('.nav-search-link').on('click', function(){
			$('.nav-search-form').find('input.orig').get(0).focus();
		});
	});
  </script>
  <?php
}

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!