
One of the new features in WordPress 3.0 is the Menu generator. This lets you create menus containing categories, pages, and links all together. However, many themes have not yet released updates to enable this functionality. In this tutorial, I will show you how to enable your Thesis powered blog to take advantage of the menus feature.
You will need to edit your custom_functions.php. Enter the following lines below all code already there, but above the ?>:
remove_action('thesis_hook_before_header', 'thesis_nav_menu');
add_action('thesis_hook_before_header', 'custom_nav');
function custom_nav() {
if ( function_exists( 'wp_nav_menu' ) ) {
wp_nav_menu( array('container'=>'', 'menu_class'=>'menu' ) );
} else {
thesis_nav_menu();
}
}
add_theme_support( 'menus' );
register_nav_menus( array(
'primary' => __( 'Navigation Menu' ),
)
);
Now, let’s explain what this all does:
The first line removes the Thesis call to the built in menu function of Thesis. The second line adds the custom function we will use to access the new WordPress 3.0 menu feature. (In both of these lines, it is assumed that you have your menu bar display at the top of the page, above the header graphic. If yours is below the header, replace thesis_hook_before_header with thesis_hook_header.)
Lines 3-8 are our custom function to display the new menu (called with the function wp_nav_menu). Included here is a check just to make sure that function does exist and use the built in Thesis menu in the case that wp_nav_menu is not there (this helps if you copy the custom functions to a site not yet upgraded to WordPress 3.0).
Line 9 (add_theme_support…) is the line that actually tells WordPress the theme can handle the new menu feature.
The remaining lines register the actual name of the navigation menu so that it displays in your dashboard’s Menu editor. You can add additional menu areas by duplicating lines 2 and 10-12 and replacing the hook area in line 2 (for a reference of hook areas, visit http://thesishooks.com/) and the ‘primary’ and ‘Navigaton menu’ in line 11 with unique names.
One caveat: this will stop the active tab in the navbar from being a different color. You can edit your custom_css to accomodate for this by specifying the class “current”. Note that this will then override the Thesis Design options setting.
Let me know how this works out for you or if you have any questions.
Did you enjoy this article?
Then why not sign up for email updates?

I'm new to CSS and could use a bit of help. On that last bit about reactivating the different background color in the menu for the current page/category (as it works with the Thesis menu, but not with the WP 3.0 menus), and you tell me what the code to specify the class “current” in custom_css is?
Thanks!
Alex–
Thanks for your question!
The WordPress Menu creator designates the current menu item with the css class “current-menu-item”. Create a statement in your custom css as follows:
.current-menu-item {background: #FFFFFF;}
This will make the background of the current menu item tab white.
I hope that helps.
–Daryl
Question — using the WP 3.0 menus seems to disable the drop-down child pages menus…. How can I get these to display again??
Thanks for your question!
Your child pages will show up as usual provided you set them up correctly in the Menu settings page. Make sure the child page is indented to the right under the parent page in the Menu settings.
Let me know if you continue to have problems.
Okay, Daryl. TOO MUCH information! LOL I am not a qualified DIY'er when it comes to WordPress and Thesis — so get to work, Mr. RTC! Get me up and running with WordPress 3.0 my Thesis theme making blog magic together! Can't wait to drive my new model blogging vehicle!
No problem, Kate. I am always happy to help. You WILL be the envy of all the girls in town.