WordPress.org

Support

Support » How-To and Troubleshooting » [Resolved] Changing default text on Search button in sidebar

[Resolved] Changing default text on Search button in sidebar

  • Hi,

    I am trying to change the default text (value) on the Search button for the default search widget in my sidebar from ‘Search’ to ‘Search Website’. From some googling around it would seem that adding this function to my child theme (of the default Buddypress theme) should do it:

    add_filter('get_search_form', 'new_search_button');
    function new_search_button($text) {
    $text = str_replace('value="Search"', 'value="Searcg Website"', $text);
    return $text;
    }

    However the text doesn’t change. Could some help with this?

    Thanks,

    Nick

Viewing 2 replies - 1 through 2 (of 2 total)
  • If your theme has a searchform.php template, the filter never triggers. In such a case, if you copy the template to your child theme, you can edit it any way you like, and it will be used instead of the parent’s template.

    Thanks bcworkz. That sorted it nicely!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Resolved] Changing default text on Search button in sidebar’ is closed to new replies.