So I’m trying to add a second menu to a WordPress template – the first I’ve got by writing the following:
<?php wp_nav_menu( array( 'sort_column' => 'menu_order', 'container_class' => 'menu-header' ) ); ?>
Now, I’ve got two menus registered in the functions.php
file, as follows:
register_nav_menu('header', 'Header Menu');
register_nav_menu('ad-menu1', 'Ad Menu One');
How do I access whatever menu is in the second nav menu registered? Or am I registering incorrectly? I’ve tried:
<?php wp_nav_menu( array( 'theme_location' => 'ad-menu1', 'container_class' => 'menu-ads' ) ); ?>
But that only gives me a list of every category, which is NOT what I want.
How do I merely grab the menu that is associated with Ad Menu One/ad-menu1?
Standard way of adding a secondary menu to a theme is as follows.
Add the function to create a new menu opening file
functions.php
andregistering
it:This brought up a 2nd menu in the Theme Menu options.
Next, add the code to the desired place on your theme file. In this case, it would be added to the footer.