• RiDFiCK

    (@ridfick)


    Hello,

    I’m making some changes to my website and one of them is putting the “Search Form” into a Menubar.

    I already have a code, but it changes both of my bars and I just want the “Search form” in the second bar.

    Can someone help me?

Viewing 7 replies - 1 through 7 (of 7 total)
  • Moderator t-p

    (@t-p)

    Thread Starter RiDFiCK

    (@ridfick)

    Thanks t-p,

    I already read the thread you give me. Will now perform some tests and then I will post here the results.

    Thread Starter RiDFiCK

    (@ridfick)

    Hello,

    I’ve done all possible changes but I can’t put the search-box in the second nav-bar.

    In some cases it creates a new line and calls the box, but I want it into the nav_bar

    Here is my /header.php

    [Code moderated as per the Forum Rules. Please use the pastebin]

    If I understand the code, I should put the code in the id=”foxmenucontainer” but I tried everything and nothing happens.

    Any Idea?

    Thread Starter RiDFiCK

    (@ridfick)

    Has anyone an idea?

    Thread Starter RiDFiCK

    (@ridfick)

    I’ve found the code and it works:

    add_filter('wp_nav_menu_items','search_box_function', 10, 2);
    function search_box_function( $nav, $args ) {
        if( $args->theme_location == 'secondary' )
            return $nav."<li class='menu-header-search'><form action='http://www.ridfick.com/' id='searchform' method='get'><input type='text' name='s' id='s' placeholder='Search'></form></li>";
    
        return $nav;
    }

    Does anyone know how to align the box to the right?

    Moderator t-p

    (@t-p)

    have tried via css, somthing like float:right;

    Thread Starter RiDFiCK

    (@ridfick)

    But it isn’t yet resolved. I need to align it right. Does someone know how to?

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Put "Search Form" into the Menubar’ is closed to new replies.