Site logo

Archived topic

search placeholder title and previous search dropdown

3 replies · Started by Marijana on October 14, 2020

Viewing posts 1–4 of 4

Hey there!

Hope that you guys could help me with this one.

I have a basic knowledge so the solution is maybe obvious but not to me.

1. I would like the title Search to be shown in a search field placeholder after clicking on it.

2. And second, is it possible to stop displaying suggestions for search in a dropdown after clicking on a search bar. Or how can I change it position to center?

Thanks

I still don't see the text inside the search placeholder in navigation bar.
But it looks good in the search widget https://prnt.sc/uzf3uj

Can you suggest more options or a css? I want it to be white.

Thanks!

Hi,

You can try this out PHP snippet out.

add_filter( 'generate_navigation_search_output', function() {
    printf(
        '<form method="get" class="search-form navigation-search" action="%1$s">
            <input type="search" placeholder="%3$s" class="search-field" value="%2$s" name="s" autocomplete="off" title="%3$s" />
        </form>',
        esc_url( home_url( '/' ) ),
        esc_attr( get_search_query() ),
        esc_attr_x( 'Search', 'label', 'generatepress' ) 
    ); 
} );

This adds the "Search" text as placeholder.

As for question 2: I've added autocomplete="off" as a workaround.

Let us know if it works for you.

This archived topic is closed to new replies.