Multiple Custom menus

Add multiple (two in this example) custom menus with multiple locations in the “theme location” box.

Put this snippet to functions.php, then place the menus in the theme files (header.php, footer.php) by placing the following wp_nav_menu functions where you want them.

Code Snippet:

<?php wp_nav_menu( array('theme_location' => 'primary-menu' ) ); ?>

Code Snippet:

<?php wp_nav_menu( array( 'theme_location' => 'secondary-menu' ) ); ?>

Done, we are now able to have different menu at the header and the footer.

Code Snippet:

add_action( 'init', 'my_custom_menus' );
function my_custom_menus() {
            'primary-menu' => __( 'Primary Menu' ),
            'secondary-menu' => __( 'Secondary Menu' )

Comments  Leave a Reply

Add a Comment

We're glad you have chosen to leave a comment. Please keep in mind that all comments are moderated according to our privacy policy, and all links are nofollow. Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.

WordPress Launch Checklist

The Ultimate WordPress Launch Checklist

We've compiled all the essential checklist items for your next WordPress website launch into one handy ebook.
Yes, Send Me the Free eBook!