Family Encyclopedia >> Electronics

How to Add a Second Menu to the Twenty Ten WordPress Theme: Video Tutorial

As a WordPress developer with years of theme customization experience, I often enhance the Twenty Ten theme's navigation. It defaults to one header menu but supports multiples via register_nav_menus(). Here's my proven method to add a secondary menu quickly.

Watch the Video Tutorial

Edit functions.php

Open functions.php and locate this comment:

// This theme uses wp_nav_menu() in one location.

The following line registers the menu using an array:

register_nav_menus( array( 'primary' => __( 'Primary Navigation', 'twentyten' ) ) );

'primary': Unique menu key.

__( 'Primary Navigation', 'twentyten' ): Human-readable description.

To add a second menu, extend the array with a new key-value pair:

register_nav_menus( array(
	'primary' => __( 'Primary Navigation', 'twentyten' ),
	'secondary' => __( 'Secondary Navigation', 'twentyten' ),
));

This approach works for other themes and child themes too. Questions? Drop a comment below—happy to help from my expertise.