0

I am trying to change wordpress search submit <input type="submit"> button to <button>. So i am trying to use str_replace. Here is my code:

add_filter('get_search_form', 'my_search_form_text');

function my_search_form_text($text) {
     $text = str_replace(
        '<input type="submit" class="search-submit" value="Search">',
        '<button type="submit" class="search-submit btn btn-outline-primary"><i class="fas fa-search"></i></button>',
        $text
     );
     return $text;
}

But it doesn't work.

wpdev
  • 195
  • 1
  • 12

1 Answers1

1

In your theme's folder searchform.php file is exists. If not copy from default theme to your theme.

Here replace your <input> with <button>

dipmala
  • 2,003
  • 1
  • 16
  • 17