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'm using my Child of TwentyTwelve

Just for your knowledge, I have two sections to my one WordPress site... one is called pain, the other called anesthesia (It's a medical site for the curious).

I have created two menus: "pain-menu" and "anesthesia-menu"... of course, I would like each menu to be seen on its corresponding section. Currently, "pain-menu" is selected for the Primary Menu and is seen all across the site.

I'm using the Default page template for the Pain section.

I have also created a page template called... wait for it... "Anesthesia." I can currently select this template when creating new pages for the anesthesia section.

Even more, this Anesthesia page template calls its own header, called 'header-anesthesia'. No surprises there.

So, the question is- how do I hard-code the call for "anesthesia-menu" in the 'header-anesthesia'... or is this even possible?

Thanks for taking the time to attempt to help.

share|improve this question
add comment

1 Answer

Use the 'theme_location' argument in header-anesthesia.php:

wp_nav_menu(
    array(
        'theme_location' => 'anesthesia-menu'
    )
);

WordPress will look for a menu assigned to this location now and pick that instead of the default menu.

share|improve this answer
    
Thanks for the very quick response, @toscho, I appreciate it. I think your suggestion is on the right path, but it didn't work correctly for me. When I applied your sample code to appropriate area within the header template, it actually combined both of the menus. My preview site: uni4painrx-preview.com Looking at my home page, you shouldn't see "welcome", "types" or "locations A"... those links belong in the anesthesia-menu. Perhaps I'm not understanding how the custom Menus work? It wouldn't be the first time I didn't' get it. : ) –  Chad Austin May 22 '13 at 6:17
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.