Tagged: 

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #848134

    Hi There,

    Within the vertical menu we would like to add a search box under the menu. How can we achieve this with functions.php or using child theme?

    Thanks!

    #848265

    Hey elbnetz,

    Please provide a link to the site/page in question so we can provide further assistance.

    Best regards,
    Jordan Shannon

    #848286
    This reply has been marked as private.
    #848460

    Hi,

    So I can seen how the menu is structured, inspect the page, and give you an accurate solution. Without actually seeing your site, I’m giving you a general answer. You do want me to be as specific as possible for your exact need right?

    Best regards,
    Jordan Shannon

    #848508

    Ok, you got the credentials.
    Thanks.

    #849447

    Hi,

    Please refer to this thread for a possible solution.

    // https://kriesi.at/support/topic/search-function-in-header-left-sidebar/#post-772268

    Best regards,
    Ismael

    #849467

    Hi Ismael,

    Thanks it works to show the magnifier icon.
    How could we achieve to just show the search field?

    Thanks

    • This reply was modified 7 years, 3 months ago by elbnetz.
    #849827

    Hi,

    Replace the code or filter with:

    /**
     * Add search toggle on left sidebar header layout
     */
    add_filter( 'wp_nav_menu_items', 'avia_append_search_side_nav', 10, 2 );
    function avia_append_search_side_nav( $items, $args )
    {
    	if (is_object($args) && $args->theme_location == 'avia')
    	{
    		global $avia_config;
    		ob_start();
    		get_search_form();
    		$form =  ob_get_clean();
    
    		$items .= '<li id="menu-item-search" class="noMobile menu-item menu-item-search-dropdown">'.$form.'</li>';
    	}
    	return $items;
    }
    

    Best regards,
    Ismael

    #850389

    Thanks, but there must be an error in the code. We see now below the menu:

    <form action="http://wp.serviceocean.com/" id="searchform" method="get" class=""> <div> <input type="submit" value="" id="searchsubmit" class="button avia-font-entypo-fontello" /> <input type="text" id="s" name="s" value="" placeholder='Suche' /> </div> </form>

    #850812

    Hi,

    Thank you for the update.

    We modified the code a bit. Please try it again then add this css code in the Quick CSS Field.

    #top #searchform > div {
        opacity: 1 !important;
        display: block !important;
    }

    Best regards,
    Ismael

    #850866

    Thanks, we used the following code and it worked well:

    /**
    * Add search toggle on left sidebar header layout
    */
    add_filter( ‘wp_nav_menu_items’, ‘avia_append_search_side_nav’, 10, 2 );
    function avia_append_search_side_nav( $items, $args )
    {
    if (is_object($args) && $args->theme_location == ‘avia’)
    {
    global $avia_config;
    ob_start();
    get_search_form();

    $items .= ‘<li id=”menu-item-search” class=”noMobile menu-item menu-item-search-dropdown”>
    ‘.$form.’
    ‘;
    }
    return $items;
    }

Viewing 11 posts - 1 through 11 (of 11 total)
  • The topic ‘Vertical Menu – Search Box under menu’ is closed to new replies.