Tagged: 

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #11338

    Hello

    is it possible to put the search form into the shop header area ?

    i looked for it in the functions.php (code below) file but i didn’t succeed to insert correctly get_search_form();

    Something like :

    <div class=’sub_menu’>

    <div>sub_menu link1 sub_menu link2 etc… </div>

    <div>get_search_form();</div>

    </div>

    thx

    fraktale

    if(!function_exists(‘avia_shop_banner’))

    {

    function avia_shop_banner()

    {

    $pos = false;

    $output = “”;

    $sub = $cart = $menu = “”;

    if(avia_woocommerce_enabled())

    {

    $sub = $cart = avia_woocommerce_cart_dropdown();

    }

    $sub .= “<div class=’sub_menu’>”;

    $args = array(‘theme_location’=>’avia2′, ‘fallback_cb’ => ”, ‘echo’ => 0);

    if(avia_woocommerce_enabled()) $args =’avia_shop_nav';

    $menu = wp_nav_menu($args);

    $sub .= $menu;

    $sub .= “</div>”;

    $output .= “<div class=’container_wrap info_text_header’ id=’shop_header’><div class=’container’>”;

    if($cart || $menu)

    {

    $output .= $sub;

    }

    else

    {

    $pos = true;

    }

    $output .= “</div></div>”;

    echo $output;

    return $pos;

    }

    }

    #71435

    You can try to add following code to functions.php (at the very bottom):

    function add_login_logout_link($items, $args)
    {
    if($args->theme_location == 'avia2')
    {
    $newitems = '<li>'.get_search_form(false).'</li>';
    $newitems .= $items;
    }
    }
    add_filter('wp_nav_menu_items', 'add_login_logout_link', 10, 2);

    However you maybe need to add custom css code to align the search form, etc.

Viewing 2 posts - 1 through 2 (of 2 total)

The topic ‘insert search form into the shop header area’ is closed to new replies.