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.

Add Secondary Menu to Sticky menu when scrolling

  • I’ve read and tried a few css fixes for this in the past but as I’m now ready to add about – ahem 200 pages to new Secondary menu, it would be really cool if GP had this as a native function. The primary Menu and off canvas for same looks lovely. Is there anything in the pipeline for giving the Secondary menu this function?

  • Hi there,

    We don’t have the plan to add the sticky function to the secondary navigation yet.

    This will be relatively complicated if the primary navigation is also sticky.

    Do you have any animation turned on for the sticky navigation? and do you have the hide on scroll down option enabled?

    If so, then there’s no way to use CSS-only method to replace the theme sticky function.

    If not, then you can disable the theme sticky function, and we can help figure out a CSS solution for you.

    Let me know!

  • Hi Ying
    I have Sticky Nav enabled ( On) for both desktop and mobile. Transition set to Fade.
    The ‘hide while scrolling down’ is disabled.
    Off Canvas Panel is enabled. Style set to Slide.
    these are my preferred settings at present for both mobile (75%) and desktop (25%) viewing.

  • Hi there,

    you can include the secondary nav inside the primary nav by:

    1. Create a new Hook Element:
    https://docs.generatepress.com/article/hooks-element-overview/
    Give it a title eg. Nest Secondary Navigation inside Primary
    Add this to the hooks text area:

    <?php generate_secondary_navigation_position(); ?>

    Select Hook: inside_navigation
    Check Execute PHP
    Set Display Rules tab Location: Entire Site.

    2. Customizer > Layout > Secondary Navigation.
    Set Container: Full Width, Inner Container: Contained, Alignment: Right, Location: No Navigation

    This will output the secondary nav inside the primary navs HTML so it will also be part of the sticky nav. It does limit the design options ie. the Secondary nav has to be immediately before ( or after the primary nav ). And it make take some CSS to position it.

  • thanks David. I’ll give it a go. I presume the alternative is just to add the secondary menu to the sticky nav instead of the primary. But it would be good to know that the idea is somewhere in the development pipeline.

  • Hi David.
    Thanks, I tried it and – it’s pretty messy I’m afraid. Sorry.
    The majority of my visitors 60K monthly are mobile based now. It would be amazing if GP could double down on expanding the navigational possibility for wp sites like mine which have hundreds of pages.

  • Ok, so – if this is only on mobile. How would this look ?
    Eg. 2 x Hambuarger menus ? Both menus in the Off Canvas ?

  • Before scrolling down ( in mobile view) both menus appear under header. Primary in center. Search to the right of that and Secondary to the left but not in alignment ( slightly above)
    When I begin scrolling down, both menus appear either side of the header which looks ok.
    However, there is no off canvas view for secondary menu. When I click on secondary menu, the off canvas view for primary menu only pops up. Only when I close the off canvas, can I then see the dropdown for secondary menu. There doesn’t appear to be an option to add both menus to the off canvas panel

  • So ideal solution would be to have a “single” menu in the off canvas that displays all items from both menus ?

  • ideally yes. At present there seems only to be the option of adding one menu to the off canvas panel

  • or better still, the option off an separate off canvas panel for an exclusive dropdown menu of secondary menu. Less clutter

  • At present there seems only to be the option of adding one menu to the off canvas panel

    That is the case, but you can create a menu only for off canvas panel, then add all menu items from both navigations to it. Does that make sense?

    Let me know 🙂

  • thanks Ying. I’ll look into that and see how I get on and let you know

  • Keep us updated 🙂

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