[Support request] Secondary Menu Search and offcanvas menu

Home Forums Support [Support request] Secondary Menu Search and offcanvas menu

Home Forums Support Secondary Menu Search and offcanvas menu

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #1669731
    Nathan

    I am trying to get my search and offcanvas menu in the secondary menu. like the following https://www.screencast.com/t/4VUTcUHa, I found the doc on using the Nav search in secondary nav, but that only works if there is an actual menu there as well. https://docs.generatepress.com/article/navigation-search/

    Is there an option to move the offcanvas menu to the secondary menu and if so, will it correct the search issue?

    #1670118
    Elvin
    Staff
    Customer Support

    Hi there,

    As more moving the search icon/bar to the secondary navigation:

    This snippet should work if you’re using Flexbox on Appearance > Customize > General.

    add_action( 'wp', function() {
        if ( 'enable' === generate_get_option( 'nav_search' ) ) {
            remove_action( 'generate_menu_bar_items', 'generate_do_navigation_search_button' );
            add_action( 'generate_secondary_menu_bar_items', 'generate_do_navigation_search_button' );
        }
    }, 20 );

    As for making the secondary navigation work as a offcanvas toggle, this will be quite tricky. You may have to resort to scripting to make it work.

    #1670420
    Nathan

    So again, that only works if there is a secondary menu assigned – https://www.screencast.com/t/GOLHYOGmrx

    If no menu assigned the search does not appear. https://www.screencast.com/t/GOLHYOGmrx

    #1670509
    David
    Staff
    Customer Support

    Hi there,

    create a blank Menu ( ie. has no menu items ) for the Secondary Nav.

    #1670516
    Nathan

    Thanks @david thats one way to get around it. Not sure GP will work for project unless I can get off canvas menu in the secondary position as well.

    #1670540
    David
    Staff
    Customer Support

    See this topic:

    https://generatepress.com/forums/topic/add-sign-in-or-join-button-in-header-that-opens-an-overlay/#post-1576020

    If not the alternative method is to swap the Primary and Secondary Navigations.

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