Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I've been reading through some of the questions and solutions people have already asked to no avail.

I have 4 menus on my WP Site, each of which will have children.

What I would like the menu to do is automatically add children to it and display it without me/someone else having to manage the menu pane.

For example:

  • About us
    • Child 1
    • Child 2
    • Child 3
    • Child 4

Where all the children pages are added as new pages, and set to have About Us as the parent.

As far as I understand now the only way is to use the menu pane. I've looked at Auto Submenu, Gecka Submenu and others, but they don't seem to help at all.

Any suggestions?

share|improve this question
    
Have you considered using wp_nav_menu( $args ) WordPress function? It should do what you want to achieve! –  sri Feb 5 at 9:14

1 Answer 1

You can use the [wp_nav_menu][1] function like so:

<?php 
    $args = array(
                'menu' => 'menu_name', //Name of menu you created in WP admin
                'depth' => 1, //define how deep you'd like the menu 0,1,2,3 etc
                'items_wrap' => '<ul><li id="item-id">Menu: </li>%3$s</ul>' 
            );
    wp_nav_menu($args);
?>
share|improve this answer
    
How would this work if I have 4 menus then? If I have one menu called About-us, information, how-to, contact-us? –  Josh Feb 5 at 16:53
    
You can pass the 'menu' option to the $args array. I've edited my answer to include this. –  Fraggy Feb 5 at 16:56
    
@josh has this solved your issue? Please mark as answered. –  Fraggy Apr 23 at 14:07

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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