WordPress Theme
Workshop: Menus
November 4th, 2017
David Bisset
davidbisset.com / @dimensionmedia
Theme Setup
Navigation Menus
register_nav_menus( array(
'primary' => __( 'Primary Menu', 'myfirsttheme' ),
'secondary' => __( 'Secondary Menu', 'myfirsttheme' ),
‘top-bar' => __( ‘Top Bar Menu', 'myfirsttheme' )
) );
You can set up multiple menus in functions.php.They can
be added using register_nav_menus() and inserted into a
theme using wp_nav_menu(),
functions.php:
Theme Setup
Navigation Menus
register_nav_menus( array(
'primary' => __( 'Primary Menu', 'myfirsttheme' ),
'secondary' => __( 'Secondary Menu', 'myfirsttheme' ),
‘top-bar' => __( ‘Top Bar Menu', 'myfirsttheme' )
) );
You can set up multiple menus in functions.php.They can
be added using register_nav_menus() and inserted into a
theme using wp_nav_menu(),
wp_nav_menu( array( 'theme_location' => ‘top-bar' ) );
functions.php:
theme file (header.php for example):
Available Options
wp_nav_menu() has alot of options…
wp_nav_menu( array( 'theme_location' => 'extra-menu', 'container_class' =>
'my_extra_menu_class' ) );
add css to the container:
Available Options
wp_nav_menu() has alot of options…
https://developer.wordpress.org/reference/functions/wp_nav_menu/
https://code.tutsplus.com/tutorials/function-examination-wp_nav_menu--wp-25525

WordPress Theme Workshop: Menus

  • 1.
    WordPress Theme Workshop: Menus November4th, 2017 David Bisset davidbisset.com / @dimensionmedia
  • 2.
    Theme Setup Navigation Menus register_nav_menus(array( 'primary' => __( 'Primary Menu', 'myfirsttheme' ), 'secondary' => __( 'Secondary Menu', 'myfirsttheme' ), ‘top-bar' => __( ‘Top Bar Menu', 'myfirsttheme' ) ) ); You can set up multiple menus in functions.php.They can be added using register_nav_menus() and inserted into a theme using wp_nav_menu(), functions.php:
  • 3.
    Theme Setup Navigation Menus register_nav_menus(array( 'primary' => __( 'Primary Menu', 'myfirsttheme' ), 'secondary' => __( 'Secondary Menu', 'myfirsttheme' ), ‘top-bar' => __( ‘Top Bar Menu', 'myfirsttheme' ) ) ); You can set up multiple menus in functions.php.They can be added using register_nav_menus() and inserted into a theme using wp_nav_menu(), wp_nav_menu( array( 'theme_location' => ‘top-bar' ) ); functions.php: theme file (header.php for example):
  • 4.
    Available Options wp_nav_menu() hasalot of options… wp_nav_menu( array( 'theme_location' => 'extra-menu', 'container_class' => 'my_extra_menu_class' ) ); add css to the container:
  • 5.
    Available Options wp_nav_menu() hasalot of options… https://developer.wordpress.org/reference/functions/wp_nav_menu/ https://code.tutsplus.com/tutorials/function-examination-wp_nav_menu--wp-25525