The below instructions have been copied from: http://www.lanexa.net/2013/03/adding-custom-menu-locations-in-wordpress-themes/
Step 1:
First, we need to register your new menus. In this example, we’ll create the menus Header Navigation and Expanded Footer. Add this PHP code to your functions.php, or link to it in a separate file:
1 2 3 4 5 6 7 8 9 10 |
// Add Your Menu Locations function register_my_menus() { register_nav_menus( array( 'header_navigation' => __( 'Header Navigation' ), 'expanded_footer' => __( 'Expanded Footer' ) ) ); } add_action( 'init', 'register_my_menus' ); |
Step 2:
Insert this code into your templates wherever you want your Header Navigation menu to appear:
1 2 3 4 5 6 7 8 |
<?php wp_nav_menu(array( 'theme_location' => 'header_navigation', // menu slug from step 1 'container' => false, // 'div' container will not be added 'menu_class' => 'nav', // <ul class="nav"> 'fallback_cb' => 'default_header_nav', // name of default function from step 2 )); ?> |
No Comment