Created
April 24, 2013 17:22
-
-
Save landru247/5453883 to your computer and use it in GitHub Desktop.
WordPress: PHP - register custom 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
// Creates custom menus | |
add_action( 'init', 'register_my_menus' ); | |
function register_my_menus() { | |
register_nav_menus( | |
array( | |
'header-nav-1' => __( 'Top Nav' ), | |
'header-nav-2' => __( 'Header main' ), | |
'footer-nav' => __( 'Footer Nav' ), | |
'policy-nav'=> __('policy Nav') | |
) | |
); | |
} | |
// Prints menu | |
<?php wp_nav_menu( array('theme_location' => 'header-nav-1','menu_class' => 'nav')); ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment