The idea would be to be able to retrieve a sub-menu matching a given page to display it as an aside on page.

As an exemple, let's consider this menu:

  • Home
  • Outdoor
    • MTB
    • Rock climbing
    • Running
    • Hiking
  • Indoor
  • About US
  • Blog

So if I'm on the Hiking page I'd want to retrieve Outdoor and all of its sub-items. For this, I figure I would first need to get menu_item_parent and then filter all items from there.

Or is there a better solution? Currently, the only way I'm seeing is to use classes on all the menu items and filter based on these classes, not optimal…

  • 1
    Put a look here: christianvarga.com/… This link help you ? – Sam Nov 22 '19 at 15:33
  • Looks like it would do the trick. I have yet to try it out. Went the "classes" path so far. – Buzut Nov 22 '19 at 20:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.