Home > Software design >  Wordpress placeholder from "search here.." to "search"
Wordpress placeholder from "search here.." to "search"

Time:07-08

I want to change wordpress placeholder from "search here..." to "search" in search area

I tried in search.php but nothing changed

CodePudding user response:

The fastest way is jQuery add this function in your theme functions.php

function search_placeholder_replace(){
?>
<script>
  (function($){
      $(document).ready(function(){
            $("input[type=search]").attr("placeholder","your new text");
        });
  })(jQuery);
  </script>
<?php

}
add_action('wp_head', 'search_placeholder_replace');
  • Related