Skip to content

Instantly share code, notes, and snippets.

@giventofly
Last active May 10, 2018 14:16
Show Gist options
  • Save giventofly/6a3de146795bfed9220cdf7b72eaf007 to your computer and use it in GitHub Desktop.
Save giventofly/6a3de146795bfed9220cdf7b72eaf007 to your computer and use it in GitHub Desktop.
wordpress add menu
function register_my_menus() {
register_nav_menus(
array(
'footer-menu' => __( 'Footer Menu' ), //footer menu
'extra-menu' => __( 'Extra Menu' ) //extra
)
);
}
add_action( 'init', 'register_my_menus' );
//on template
<?php wp_nav_menu( array( 'theme_location' => 'footer-menu' ) ); ?>
//wrapper class
<?php wp_nav_menu( array(
'theme_location' => 'extra-menu',
'container_class' => 'my_extra_menu_class', //wrapper calss
'menu_class' => '', //menu class
) ); ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment