• Hello!

    I have a webpage with a lot of pages and a menu on the sidebar. Most pages are children (topics) under a parent page (the subject of the topic). When opening one of the child pages the menu on the sidebar opens with the parent page expanded. Because there are many child pages this makes the page very long, and it pushes the searchbar and ad to the bottom of the page. Try opening this page for example. Note how much of the page’s length is just the sidebar, and how the page becomes shorter and neater when you manually collapse the parent page on the menu.

    I want the parent page to be collapsed when you open a child page. How do I go about doing that?

    I appreciate all replies.

    The page I need help with: [log in to see the link]

Viewing 5 replies - 1 through 5 (of 5 total)
  • You can use some CSS like this

    .main-navigation li.current-page-parent ul {
    	display: none;
    }

    However, the issue here is that it hides the sub menu for that menu item until you move onto a different page. Ideally you’d still want the sub menu to be visible on a dropdown action but keeping it hidden until it is clicked…I’ll try to think on this more to see if I can come up with a working solution.

    Thread Starter mrnick1

    (@mrnick1)

    Yeah, I really appreciate your answer, but unfortunately it’s not a good solution as it is. If you could find an ideal solution that would be amazing.

    Hi, didn’t forget about you. Unfortunately I haven’t been able to come up with a working solution for this outside of using a child theme and modifying the menu code in order to get the desired effect.

    Thread Starter mrnick1

    (@mrnick1)

    That’s so nice, thank you!

    I’d be willing to set up a child theme if you know how to solve it with one. Could you help me with that too?

    Thread Starter mrnick1

    (@mrnick1)

    By that I mean that I need help with modifying the menu code in a child theme, not setting up the child theme itself. I can probably manage that on my own.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Sidebar menu collapsed instead of expanded’ is closed to new replies.