I’m a wordpress beginner and at the moment struggling to get to grips with custom menus. I have created two menus. WordPress tells me the theme supports two menus. I have
<?php wp_nav_menu('menu=services_menu'); ?>
Where I want one menu to appear. I have
<?php wp_nav_menu('menu=left_navigation'); ?>
Where I want the other menu to appear.
I have
<?php
if ( function_exists( 'register_nav_menus' ) ) {
register_nav_menus(
array(
'services_menu' => 'Services menu',
'left_navigation' => 'Left vertical navigation Menu'
)
);
}
?>
In functions.php.
Both menus appear under “Appearance -> menus ->Theme locations” and are associated correctly. But only the services menu ever appears, in both locations. I’ve read a welter of different solutions to doing this, none of which seem to have any result other than the one described above. Where am I going wrong?
The problem is that
wp_nav_menu()
should really only ever be callingtheme_location
, notmenu
.The Theme defines menu locations, and then places those menu locations in the template. The user defines menus, and assigns menus to theme locations.
So, change this:
…to this:
possibly?