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 got two wp_nav_menu's defined - main and sub. The backend menu editor lets me add pages or categories or custom links to my menu, and I can place them under existing pages/categories/links.

However, I want to add my sub pages to the sub menu, and then be able to add that sub menu as a whole item to my main menu.

That way, if I change up what's in my sub menu, I don't also have to go change my main menu too, see what I mean. Nice and DRY. Useful if I have my submenu in multiple places (like as a drop down from the main menu, plus on a detail page in the sidebar.)

Is this possible? Is there a plug in or custom function? Thanks.

share|improve this question
add comment

1 Answer 1

You could perhaps accomplish this via a custom walker, but I suggest you try a single menu containing submenus and display the submenus in other contexts by outputting just that branch of the main menu. see Display a portion/ branch of the menu tree using wp_nav_menu(), specifically this answer.

share|improve this answer
    
Hmmm, interesting approach, I didn't think of that, I guess it can work, but it's still rather complex, especially for end users. I was hoping to find a way to add an "add menu" metabox with a dropdown of other menues. If I don't get a closer answer I'll credit your answer as a possible alternate solution. –  Jeff Jul 17 '12 at 16:12
add comment

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.