• sheraton

    (@sheratonwalls)


    I would like to get a code for my search bar on my site. Example in the search bar it said (Serach) I would like to change this to (search Homes, Photos, Videos, Pros and More) I would like to enter the code in my css plugin.

    Thanks

Viewing 2 replies - 1 through 2 (of 2 total)
  • Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    What you seemingly want to do is to change the placeholder in the search field. Is that correct?

    If so, you do that via code, not CSS.

    Here’s a sample of how to do it: It replaces “Search” with “Search site for”
    This code goes in your theme’s functions.php file.

    /* modify search form text */
    function tachp_search_form($html)
    {
        $html = str_replace('placeholder="Search ', 'placeholder="Search site for ', $html);
    
        return $html;
    }
    add_filter('get_search_form', 'tachp_search_form');
    Thread Starter sheraton

    (@sheratonwalls)

    I used the code, however the site did not like it, so I had to remove it.

    Thanks

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Search Bar’ is closed to new replies.