Tell me more ×
WordPress Answers is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

When I go to [Appearance > Menus] and attach menu to its area and refresh that page it disappears. This happens only on one WordPress theme (but not on default).

Do you have any ideas what could cause that? I'm using WP 3.4.2.

The theme registers two menu areas (they appear but nothing can be attached to them):

register_nav_menus( array('main_menu' => 'Main Menu', 'mobile_menu' => 'Mobile Menu') );

AJAX Response is the same in both cases. 200 OK.

share|improve this question

closed as too localized by toscho Apr 27 at 12:04

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, see the FAQ.

1 Answer

1) First step is to register a menu or menus in your theme functions.php file or your my-plugin.php file.

<?php register_nav_menu( 'your-menu-handle', 'Your Menu Lable' ); ?> 

Read More: http://codex.wordpress.org/Template_Tags/register_nav_menu

Or

<?php register_nav_menus( array('main_menu' => 'Main Menu', 'mobile_menu' => 'Mobile Menu') ); ?> 

Read More: http://codex.wordpress.org/Function_Reference/register_nav_menus

2) Go to Appearence > Menus in your WordPress Admin interface. Now you should see the newly created 'Your Menu Lable' menu. Add a new menu created using the admin interface to the new menu placeholder.

3) Then to display the 'Your Menu Lable' menu, add the following code to theme file (header.php or sidebar.php)

<?php wp_nav_menu( array('menu' => 'Your Menu Lable' )); ?>

Or

<?php wp_nav_menu( array('menu' => 'Main Menu' )); ?>

Read More: http://codex.wordpress.org/Function_Reference/wp_nav_menu

Following these three steps should display the menu/menus.

share|improve this answer
That's exactly what I do. In step (2) I see newly created 'Your Menu Lable' menu area and I pick my menu to the left and I save settings. Then I refresh that page and it's gone. It can't be attached in any way. The same place works flawlessly with Twenty Eleven theme though. I followed all your steps with EXACTLY the code you provided. Everything appears in admin panel but it is not possible to attach menu. It's just gone after WordPress settings save... – Paul Sep 16 '12 at 11:17

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