Where can I edit "Search" in header navigation

Hi,

I want to edit the word “Search” in the header navigation.
It’s the “word” which is displayed in the search form.

For better understanding I attached a screen.

I tried to edit the wording in the searchform.php wihout any effect.

Thanks in advance!

Cheers,
Sandro

See here the code of the searchform.php (I tried to replace “Search” with “Suche”)

<?php
/**

  • The template for displaying search forms in activello
  • @package activello
    */
    ?>

<form role=“search” method=“get” class=“form-search” action="<?php echo esc_url( home_url( ‘/’ ) ); ?>">
<div class=“input-group”>
<label class=“screen-reader-text” for=“s”><?php _e( ‘Search for:’, ‘activello’ ); ?></label>
<input type=“text” class=“form-control search-query” placeholder="<?php echo esc_attr_x( ‘Suche;’, ‘placeholder’, ‘activello’ ); ?>" value="<?php echo get_search_query(); ?>" name=“s” title="<?php echo esc_attr_x( ‘Search for:’, ‘label’, ‘activello’ ); ?>" />
<span class=“input-group-btn”>
<button type=“submit” class=“btn btn-default” name=“submit” id=“searchsubmit” value="<?php echo _e( ‘Suche’, ‘activello’ ); ?>"><?php echo esc_attr_x( ‘Suchen’, ‘submit button’, ‘activello’ ); ?></button>
</span>
</div>
</form>

Hi @Sandro,

I hope you are well today and thank you for your question.

You can try achieving this by using the attached small plugin specially developed for you that contains the following custom code.

function colorlib_change_translate_text( $translations, $text, $context, $domain ) {
	if (strpos($text,'Search') !== false) {
	   $text = str_replace("Search","Custom Text", $text);
        }
	return $text;
}
add_filter( 'gettext_with_context', 'colorlib_change_translate_text', 99, 4 );

Change the words “Custom Text” in the above plugin code to whatever you want to display in place of Search word.

Best Regards,
Movin

Thanks mate!

It really works! Thank you for your amazing support! All the best, Sandro

You are most welcome here :slight_smile:

Hi @Movin,

instead of using your plugin I found where I can change the wording:

Design > Editor > Theme function

  1. changed: placeholder="'. esc_attr_x( __('Search', 'activello'),
  2. into: placeholder="'. esc_attr_x( __('Suchen', 'activello'),

Just to let you and other users know!

Cheers,
Sandro

Hi Sandro,

You can also do it by editing the theme files that you did above but please note you are making changes in the theme files therefore you have to make these changes again after theme updation as changes made in the theme files get lost on theme updation.

Cheers,
Movin

Hi Movin,

thanks for giving me this hint. I never thought about it.

Cheers,
Sandro

You are always welcome here :slight_smile: