2

I was reading Wordpress documentation and also trying to find some clear example of how to do this but I couldn't, sorry if this is posted elsewhere but I did my best trying to find an answer before posting.

My question is simple, if I use the wp_nav_menu function of wp, what should I do in the array or any other place to show one specific element and it's childs.

So for example, I have a menu Home, About, Services. My question would be how to show only Services for example with it's childs.

Is that even possible? Thanks in advance.

2 Answers 2

1

Why would you only want to display one item from a menu of many items? You can create additional menus by registering them in your functions.php file and then associating then in the Appearance -> Menus area of the WP-Admin.

http://justintadlock.com/archives/2010/06/01/goodbye-headaches-hello-menus

2
  • Thanks for your answer, but the thing I'm looking for is to not have to create new menus (that will be like a part only of the main menu) indeed. That's why I'm looking to only show a single item of the main menu. Get my point? Thanks!
    – Jaypee
    Commented Aug 23, 2012 at 19:11
  • The answer sounds stupidly simple. Will work for me.
    – TARKUS
    Commented Apr 1, 2021 at 16:17
1

After searching some more I found this great answer, they key was to use a custom walker.

Display a portion/ branch of the menu tree using wp_nav_menu()

Best.

1
  • Hi @Jaypee. Great that you found a solution! You can select your own answer as the accepted answer.
    – Lea Cohen
    Commented Mar 20, 2013 at 6:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.