Hi support team
It’s been a while sience my las post and that’s because enfold template works so well that i don’t really have to worry :)
This time i would like to have a restriction for the number of characters that people write in the search bar to look for any article in my website.
I hope you guys can help me with this like always.
Best regards
Hi claraelisa!
That is great! :)
Please add following code to Functions.php file in Appearance > Editor
function add_search_limit(){
?>
<script>
jQuery(window).load(function(){
jQuery('#top #s').attr('maxlength','50');
});
</script>
<?php
}
add_action('wp_footer', 'add_search_limit');
It would limit the search input to 50 characters. If that is not what you meant, please elaborate :)
Cheers!
Yigit
Forget it. I found out what i was doing wrong. Your code works great. Thank you soo much. It was extremely helpful :)