Created
May 22, 2012 21:45
-
-
Save plavet/2771828 to your computer and use it in GitHub Desktop.
Wordpress - Custom Navigation Menus
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Custom Navigation menus | |
* | |
* insert to functions.php | |
*/ | |
add_action( 'init', 'my_custom_menus' ); | |
function my_custom_menus() { | |
register_nav_menus( | |
array( | |
'primary-menu' => __( 'Primary Menu' ), | |
'secondary-menu' => __( 'Secondary Menu' ) | |
) | |
); | |
} | |
/** | |
* Use in template | |
* | |
* | |
*/ | |
<?php wp_nav_menu( array('theme_location' => 'primary-menu' ) ); ?> | |
<?php wp_nav_menu( array( 'theme_location' => 'secondary-menu' ) ); ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment