WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Please help with menu registeration:

I have followed this guide (http://codex.wordpress.org/Navigation_Menus) step by step.

Added the following code to functions.php:

function register_my_menus() {
    array('header-menu' => __( 'Header Menu' ) )

add_action( 'init', 'register_my_menus' );

But the guide says that this will make the menu appear in the Appearance -> Menus admin screen in the "Theme Locations" box as "Header Menu".

When I go to Appearance -> Menus everything is greyed out and there is no option of "Theme Locations"

share|improve this question
Add a screenshot of wp-admin/nav-menus.php. And do something with your other orphaned questions. – toscho Feb 26 '12 at 4:49
up vote 2 down vote accepted

You don't need to add any action to register your Nav Menu. Here are some quick steps for you to get your Wordpress Nav Menu to work...

Register Nav Menu

if (function_exists('register_nav_menu'))
    register_nav_menu('header_menu', 'Header Menu');

Define and Use Nav Menu in your Theme: Usually we place the Menu DIV code in header.php file; so I assume yours is also in header.php file. Open that file and locate the DIV container where you wish your Wordpress NAV menu to appear. Here is a sample from one of my recent Wordpress themes for your ready reference:

<div class="css-nav" >

<?php wp_nav_menu( array(
    'sort_column' => 'menu_order',
    'theme_location' => 'header_menu',
    'menu_class' => 'css-menu',
    'title_li' => '<div class="l"></div>',
    'link_before' => '<span class="l">',
    'link_after' => '</span>'
) ); ?> </div>

Once you add this code, go to your WP Admin - Menus. Create a new Menu, if you don't have any yet. As soon as you create a menu, you should see "Theme Location" meta box to the left side of your Menu Item arranger area.

I hope this helps. :-)



share|improve this answer
+1 for a well-formatted, good answer from a new user. Welcome to WPSE. :) – Jared Feb 26 '12 at 5:09
function_exists('register_nav_menu') doesn't do anything useful: nav-menu.php is loaded before the theme’s functions.php (see wp-settings.php). 'sort_column' and 'title_li' are not valid arguments. – toscho Feb 26 '12 at 5:28
Thanks...This works! Finally! Documentation at Wordpress could use a serious update – php-b-grader Feb 26 '12 at 5:38

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.