Archived topic
Change language of search box label
9 replies · Started by Gonzalo on October 30, 2020
Hi there, where I can change language of search box label?
http://prntscr.com/va9d0d
Hi there,
Try this filter:
https://docs.generatepress.com/article/generate_search_placeholder/
Thank you Leo,
for this code, can I use a hook?
add_filter( 'filter_name', 'generate_search_placeholder' );
function generate_search_placeholder()
{
return 'Buscar';
}
No that's a filter so one of these methods:
Adding PHP: https://docs.generatepress.com/article/adding-php/
Thank you Leo, working.
In case it helps another user, I use this code with Code Snippets plugin:
add_filter( 'generate_search_placeholder', 'gs_change_search_language' );
function gs_change_search_language()
{
return 'Buscar';
}
Where 'gs_change_search_language' it's my own function.
Thanks for sharing!
Hello,
I am trying to do the same thing as Gonzalo. I used his code with Code Snippets (thanks) but it doesn't seem to work. A few things:
- I am using Relevanssi for search and asked the developer for input here
- I don't see the original text "Search" even when I deactivate the Relevanssi plugin.
Any ideas?
Hi there,
can you raise a new topic and share a link to your site where we can see whats going on.
Found the answer: https://docs.generatepress.com/article/generate_navigation_search_output/#add-a-placeholder, thanks.
Glad to hear that!