Site logo

Archived topic

Align search field in navigation bar

6 replies · Started by PROCESO COLECTIVO on April 30, 2020

Viewing posts 1–7 of 7

Hi, I need your help with my search field, I want my search field after the menu in navigation bar, the code that I use is this:
the hook

<form role="search" method="get" class="search-form" action="<?php echo esc_url( home_url( '/' ) ); ?>">
    <label>
        <span class="screen-reader-text">Search for:</span>
        <input type="search" class="search-field" placeholder="Search..." value="<?php echo get_search_query(); ?>" name="s" />
        <input type="hidden" name="post_type" value="products" />
    </label>
    <input type="submit" class="search-submit" value="&#xf002" />
</form>

In CSS:
`.inside-navigation .search-form {
float: left;
line-height: 60px;
}
.main-navigation .search-submit {
font-family: GeneratePress;
}`

Imagen

But the search field is always before the menu, do you have a good advice?

Thanks for your answer, I´m going to use the navigation search option, but I want to ask is there a way to put the word search before the icon in the navigation search.

thanks for your advice

Thanks for your help at the end Use this little modification

.search-item a:before {
    content: "\f002";
		 font-family: GeneratePress;
}
.search-item a:after {
    content: " BUSQUEDA";
    font-family: Brown-Regular;
}

Glad I could help :)

This archived topic is closed to new replies.