[Resolved] Align search field in navigation bar

Home Forums Support [Resolved] Align search field in navigation bar

Home Forums Support Align search field in navigation bar

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #1263542
    PROCESO COLECTIVO

    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?

    #1263544
    PROCESO COLECTIVO
    #1263942
    Leo
    Staff
    Customer Support

    Hi there,

    Have you considered using our navigation search option?
    https://docs.generatepress.com/article/navigation-search/

    If you prefer to use the search field instead, can you try creating a shortcode for it:
    https://generatepress.com/forums/topic/search-box-in-the-header/#post-1253293

    Then add it using the inside_navigation hook in hooks elements?
    https://docs.generatepress.com/article/hooks-element-overview/

    Let me know 🙂

    #1265247
    PROCESO COLECTIVO

    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

    #1265559
    Tom
    Lead Developer
    Lead Developer
    #1265683
    PROCESO COLECTIVO

    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;
    }
    #1266392
    Tom
    Lead Developer
    Lead Developer

    Glad I could help 🙂

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