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.

My problem is that wordpress isn't showing the two menu's as separate menus, it just outputs on menu to both positions.

URL: http://www.msc-media.co.uk

Check the header and footer for the links - I know the footer is ugly, need to sort out the css later.

I've created two menus in the functions.php with this code.

<?php
    register_nav_menus( array(
        'topmenu' => 'Top Menu',
        'footermenu' => 'Footer Menu',
    ) );

?>

I've then called these menu's in my footer.php and header.php with this code:

<?php wp_nav_menu(array('menu' => 'footermenu')); ?>
<?php wp_nav_menu(array('menu' => 'topmenu')); ?>

This is my back-end config with wordpress, getting the top menu to show 4 links, and the footer to display two. With the positions correctly appointed.

enter image description here

Can anyone explain what is wrong with this? - I'm stumped and I've searched the WP codex/forums for hours now.

share|improve this question

migrated from stackoverflow.com May 15 '12 at 22:49

This question came from our site for professional and enthusiast programmers.

1 Answer 1

up vote 0 down vote accepted

Try:

<?php wp_nav_menu(array('theme_location' => 'footermenu')); ?>
<?php wp_nav_menu(array('theme_location' => 'topmenu')); ?>

See http://codex.wordpress.org/Function_Reference/wp_nav_menu

share|improve this answer
    
Worked perfectly, what are the differences between 'theme_location' and 'menu'? –  MChandler May 15 '12 at 22:55
1  
@MChandler Menu accepts the slug of the menu you've created. Theme location accpets a registered theme location. The user can then create a menu, and assign to one (or more) locations, where it will then appear. In theme development, you should never use the 'menu' attribute. –  Stephen Harris May 15 '12 at 23:03

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.