// Add this to your functions page to create a menu with a search bar

add_filter('wp_nav_menu_items','add_search_box');
function add_search_box($items, $args) {
 
        ob_start();
        get_search_form();
        $searchform = ob_get_contents();
        ob_end_clean();
 
        $items .= '<li class="search">' .$searchform . '</li>';
 
    return $items;
}