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.

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

<?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:

<?php
add_action( 'init', 'my_custom_menus' );
function my_custom_menus() {
    register_nav_menus(
        array(
            'primary-menu' => __( 'Primary Menu' ),
            'secondary-menu' => __( 'Secondary Menu' )
        )
    );
}
?>

Posted in Pure hacks