I’m trying to figure out how I can get a sub-menu part of a main navigation menu, and from what I’ve found in the wordpress docs, there doesn’t seem to be a built-in way to do it.
I have thought that the most logical function to use is wp_nav_menu() and that lets me pass how many levels I want to display, but it doesn’t let me specify a starting node/level.
As an example, say I have a menu structure like this:
Page 1 Page 1.1 Page 1.2 Page 2 Page 2.1 Page 2.2 Page 2.2.1 Page 2.2.2 Page 2.2.3 Page 2.3
What I want to do is be able to start the menu at ‘Page 2.2’ and display the sub-pages from there. So, the menu that I’m trying to end up with would be:
Page 2.2 Page 2.2.1 Page 2.2.2 Page 2.2.3
Is there any “easy” built-in way to get a menu structure like this,or do I need to write all of my own functions to achieve this?
- The topic ‘Get a part of a navigation menu’ is closed to new replies.