OnPoint Plugins

  • Plugins
    • Advanced Sidebar Menu
    • Go Live Update Urls
  • About
    • Services
    • Showcase
  • Blog
  • Contact
  • Support
  • Log In
← Back to support

Navigation menu accordion open current section

Resolved

Requested: 5 months and 1 day ago

Hi,

We’re having an issue where the sidebar doesn’t have the same accordions open when cyckling though the pages.
So if we have parent menu #1 open with a child menu, can we have it so that when we press a link and get to the new page (where the sidebar is also active) that those accordions are open instead of all being closed?

Regards

Plugin: Advanced Sidebar Menu

  1. OnPoint Plugins

    5 months and 1 day ago

    Hi Niklas,

    There is currently no reasonable way to track which sections of the accordion have been clicked on between pages because the accordion reloads each time a new page is viewed. That being said, there are a couple of approaches to accomplish similar behavior.

    Approach #1

    Uncheck the “Close all accordion sections until clicked” option. This will automatically open the accordion to the current page or menu item. The tradeoff is all top level sections will be open when not viewing an item included in the menu.

    Normally, just the section being viewed would be open when viewing a top level section. In the case of your particular menu, the same top level item is used in multiple sections so all of the sections open when any of the top level items are viewed.

    Approach #2

    Use a filter to change the “Close all accordion sections until clicked” option based on whether you are on a child menu item or not. This will keep all sections closed when not viewing a child item included in the menu and open to the current menu section when viewing a child item.

    Approach #2 may be used by adding the following filter to your active theme’s functions.php file.

    Have a great day!

     

New Response Cancel reply

You must be logged in to respond. Only PRO members are allowed to respond to support requests.

© 2023 · WordPress Development · Terms Of Service · Privacy Policy · Cookie Policy · Log in

  • Plugins
  • Blog
  • Contact