Are you a GenerateCustomer?

Do you have an active GP Premium or GenerateBlocks Pro license key?

Create a GenerateSupport account for GeneratePress and GenerateBlocks support in one dedicated place.

Create an account
Already have a GenerateSupport account? Login

Just browsing?

Feel free to browse the forums. Support for our free versions is provided on WordPress.org (GeneratePress, GenerateBlocks).

Want to become a premium user? Learn more below.

Dynamically change secondary menu mobile breakpoint

  • Hi there,

    I have a secondary menu that has a varying amount of content per category (or book):

    Is there a way that when the menu goes to two lines, it automatically breaks to mobile?

    Kind regards,

    Will

  • Hi there,

    What did you use to build the secondary menu? A link to your site would be helpful too.

  • Hi Alvind,

    It’s a standard secondary navigation menu that is put after the header using GP hook.

    I’ve attached details of the staging.

    I also have another issue the whole width I want to have a background, and the secondary menu to be contained to the width of the website – is there a way to do this too?

    Kind regards,

    Will

  • Hi there,

    unfortunately theres no easy way to do that. Even Javascript couldn’t easily determine a flex row would span 2+ rows.

    The most i can offer is some CSS to make the nav scrollable on smaller screens:

    
    @media(min-width: 769px) {
        .secondary-navigation {
            overflow-y: hidden;
        }
        nav.secondary-navigation .main-nav>ul {
            flex-wrap: nowrap; 
        }
        .secondary-navigation li {
            min-width: max-content;
        }
    }
    

    Its nothing fancy but it at least keeps the nav to a single row.

  • Okay thanks for that David, that is still a great help.

  • You’re welcome

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