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>
movin
April 19, 2016, 6:56am
2
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
movin
April 20, 2016, 6:50am
4
You are most welcome here
Hi @Movin ,
instead of using your plugin I found where I can change the wording:
Design > Editor > Theme function
changed: placeholder="'. esc_attr_x( __('Search', 'activello'),
into: placeholder="'. esc_attr_x( __('Suchen', 'activello'),
Just to let you and other users know!
Cheers,
Sandro
movin
April 25, 2016, 6:30am
6
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
movin
April 27, 2016, 6:46am
8
You are always welcome here