How to add new menu’s to a WordPress theme in the Functions.php file

Search for the register_nav_menus function and add some more menus to go other places in your theme.


// This theme uses wp_nav_menu() in one location.
register_nav_menus( array(
'primary' => __( 'Primary Navigation', 'twentyten' ),
'footer' => __( 'Footer Navigation', 'twentyten' ),
'sidebar' => __( 'Sidebar Navigation', 'twentyten' ),
) );

To insert your new menu somewhere in your theme files


< ?php wp_nav_menu( array( 'container_class' => 'menu-header', 'theme_location' => 'primary' ) ); ?>

Leave a Reply

Your email address will not be published. Required fields are marked *

Time limit is exhausted. Please reload CAPTCHA.