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 (GeneratePress, GenerateBlocks).

Want to become a premium user? Learn more below.

Brand Theme – Auto-Open Submenu Hook Issue

  • Hi,

    I’m using the Brand Theme as the basis of a new website I’m creating and I notice the left sidebar (Primary Navigation) sub-menus close when anything is added to the URL, for example:

    This is the one of the menus:

    This is the sub-menu:

    Now, on the submenu page I a few html anchors setup to scroll the user down to that section, for example:

    The user hasn’t left the page, only clicked to scroll down to that section, but by doing so, the sub-menu will close despite the user still reading that same page.

    This is the hook that auto-opens the sub-menus (came with the Brand theme):

    const sideNav = document.querySelector(‘.gen-sidebar-nav’);
    var menu = sideNav.querySelectorAll(‘.current-menu-ancestor’);
    if (menu) {
    var menuChild = menu[0].querySelectorAll(‘.sub-menu’);
    if (menuChild) {

    Would it be possible to modify this so that adding #whatever to the URL would not close the sub-menu please?


  • Hi there,

    is it possible to see the issue on your site ? So I can try figure out what is going on there

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