0

I'm creating a custom WP theme and trying to add custom menus to the header. I've been able to get custom menus to work in page templates but not in header.php. I'm using register_nav_menus in functions.php and setting them up from the WordPress GUI. When I add a menu to my header via wp_nav_menu, I always get the same default menu. Is this a glitch? Am I doing something wrong?

Here's my functions.php code:

function bt_register_custom_menus() {
  register_nav_menus(array('header_left' => __('Header Left'), 'header_right' => __('Header Right')));
}
add_action('init', 'bt_register_custom_menus');

Here's my header.php code:

<?php wp_nav_menu( array('theme-location' => 'header_left' )); ?>
<?php wp_nav_menu( array('theme-location' => 'header_right' )); ?>

1 Answer 1

1

Is it theme_location not theme-location

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.