Site logo

Archived topic

Change Placeholder and Title of the Searchbar in a Widget

3 replies · Started by Sven on June 20, 2019

Viewing posts 1–4 of 4

Hi,

I want to customize my searchbox.

For changing the placeholder I using the filter 'generate_search_placeholder' and it works perfect.

But there is another unlovely element I want to disable, the title during mouse over:

<input type="search" class="search-field" placeholder="Suche …" value="" name="s" title="Suche nach:">

For a better understanding: https://drive.google.com/open?id=1ttVEoVmrNbeNRTPOTqSg-QePlX25r2iu

Any idea to fix it?

Thx in advance!

Hi there,

couldn't access the video - but if you mean the Hint Tool Tip that appears then this is because of the Title attribute in the input field. As its created by the browser the simplest way is to remove the Title Attribute using this PHP Snippet:

add_filter('get_search_form', 'my_search_form');
 
function my_search_form($text) {
     $text = str_replace('title="Suche nach:', 'title=""', $text);
     return $text;
}

Hi David,

it's a pleasure to work with GeneratePress and your support.

11 minutes response time - incredibly :-)

And with the perfect solution. It works great. I love it!

By the way, I forgot the access right for the link. Now it works.

Thx and best
Sven

Awesome glad to be of help - and thanks for the great feedback.

This archived topic is closed to new replies.