[Resolved] Change Placeholder and Title of the Searchbar in a Widget

Home Forums Support [Resolved] Change Placeholder and Title of the Searchbar in a Widget

Home Forums Support Change Placeholder and Title of the Searchbar in a Widget

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #935953
    Sven

    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!

    #935977
    David
    Staff
    Customer Support

    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;
    }
    #936131
    Sven

    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

    #936149
    David
    Staff
    Customer Support

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

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.