Last active
December 23, 2015 18:39
-
-
Save barbwiredmedia/6677341 to your computer and use it in GitHub Desktop.
Wordpress - Functions: Creates custom menus, register my menus, wp nav menu
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') | |
) | |
); | |
} | |
//Register Menus 4.0+ | |
register_nav_menus(array( | |
'footer-nav-1' => 'Footer Navigation One', | |
'footer-nav-2' => 'Footer Navigation Two', | |
'footer-nav-3' => 'Footer Navigation Three', | |
)); | |
// 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