Viewing 10 replies - 1 through 10 (of 10 total)
  • Thread Starter Tanmay Kumar Das

    (@tanmay-kumar-das)

    Also it this possible to hide other sub menu after clicking another parent?

    Plugin Author WPBean

    (@wpbean)

    For first issue you can do it easily by adding few lines of css. Every active menu has a class by that class make child display block.

    No second issue is not possible.

    Thanks

    I also would like to have the sub menus of the active page displayed. The currently selected item class is .current-menu-item and the child class is .sub-menu, but I can’t work out how to refer to them.

    .wpb_category_n_menu_accordion > ul > li.current-menu-item .sub-menu {
      display: block;}

    Doesn’t work. Any help would be appreciated.

    I’m afraid this is on a local development copy, so I can’t give an address to show you.

    Plugin Author WPBean

    (@wpbean)

    @bentheimmigrant please let me know when your site on live server. I need to check that first.

    Thanks

    Will do, thanks.

    Figured it out: I was on the right lines, but the menu has “display: hidden” written into the HTML. It needed an “!important” tag to override it.

    Spoke too soon. Here is the CSS:

    .wpb_category_n_menu_accordion ul  li.current-menu-ancestor > ul {display: block!important;}
    .wpb_category_n_menu_accordion ul  li.current-menu-parent > ul {display: block!important;}
    .wpb_category_n_menu_accordion > ul li.current-menu-item >ul {display:block!important;}

    This achieves the goal of opening the parent of the active link, as well as the submenu below it. However, when you click on the accordion indicator button, then menu disappears (as expected) and then reappears.

    Any idea how to override the “hidden” value in the markup, but without also overriding the js?

    The site is now live: https://flexprocess.co.uk/ using the accordion menu for the sidebar menu.

    When you navigate to a page, you’ll see that the current page and any ancestors are opened. However, because I did it through CSS, I have to use !important to override the js.

    This also means the menu just doesn’t know it’s open, and so the + sign isn’t rotated like when you open an inactive menu.

    I assume this has to be done via js, to simulate clicking the menu open on page load?

    Thanks

    I would love some answers on this as well.

    Plugin Author WPBean

    (@wpbean)

    Hello everyone,

    Thanks for using this plugin.
    It’s a premium feature of this plugin. We already added this feature to it’s premium version.
    https://bit.ly/1N1YWnx

    Thanks

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘How to automatically open sub menu when parent menu is active’ is closed to new replies.