[Support request] Menu under mobile header

Home Forums Support [Support request] Menu under mobile header

Home Forums Support Menu under mobile header

Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • #2002470
    johnzoro

    Can you do q menu that goes left to right under the mobile header

    #2002573
    David
    Staff
    Customer Support

    Hi there,

    you can use the Secondary Navigation and disable its Mobile Behaviour – see doc here:

    https://docs.generatepress.com/article/disable-secondary-navigation-mobile-menu/

    The swipe left/right can do with a little CSS, if thats required, then set up the site with the nav and let me know and i can take a look

    #2003276
    johnzoro

    i don’t want the secondary menu to appear in desktop only mobile?

    #2003353
    Ying
    Staff
    Customer Support

    i don’t want the secondary menu to appear in desktop only mobile?

    It can be hidden by CSS. Once the layout is ready, we can have a look at your site and help with CSS.

    #2003549
    johnzoro

    ok how do i hide it via css?

    #2003705
    David
    Staff
    Customer Support

    You can add this to hide on on desktop:

    @media(min-width: 769px) {
        #secondary-navigation {
            display: none;
        }
    }
    #2003717
    johnzoro

    hmm i added that css but the menu still shows on desktop

    #2003721
    David
    Staff
    Customer Support

    Remove the CSS, and Paste it in at the top of the Customizer > Additional CSS

    #2003876
    johnzoro

    Thanks that worked!

    #2003991
    David
    Staff
    Customer Support

    That means there is an error in your other CSS.
    Check to make sure that any other @media queries are closed.

    Eg. this is how the CSS should look:

    @media(max-width: 768px) {
        .some-css-selctor {
            some CSS going on here
        }
    }

    Note the second closing bracket – looks like you’re missing one in your other CSS

    #2004044
    johnzoro

    yeah i was missing a }

    #2004073
    johnzoro

    I did the php by adding it to a code snippet and adding the CSS, now the second menu doesn’t show at all on desktop or mobile.

    Is that right?

    #2004106
    David
    Staff
    Customer Support

    So for the CSS in this doc:

    https://docs.generatepress.com/article/disable-secondary-navigation-mobile-menu/

    Remove that – and use this instead:

    @media (max-width: 768px) {
        .secondary-navigation {
            text-align: center !important;
            overflow-x: scroll;
            -ms-overflow-style: none;
            scrollbar-width: none;
            scroll-snap-type: x mandatory;
        }
    
        .secondary-navigation .main-nav>ul {
            display: flex !important;
            flex-wrap: nowrap;
        }
    
        .secondary-navigation .sf-menu>li {
            flex: 1 0 120px;
            scroll-snap-align: center;
        }
    }
    
    .secondary-navigation .menu-toggle {
        display: none;
    }

    Note this line:

    flex: 1 0 120px;

    the 120px sets the width of the scrollable menu items. Adjust this to suit.
    Rest of the menu item styling is still controlled by the customizer

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