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

OK, this is a basic question...I'm upgrading a theme I built (from scratch) to support 3.0 menus (finally).

With the new wp_nav_menu tag, as expected, the tag's default container is added when a custom menu is assigned only. The added div prevents the custom menu from taking the css I previously created.

I need to be able to support both default and custom menu. Rather than bulking out my css with added selectors to support the new class, I'd like to null the container and container_class in the wp_nav_menu array and state the container in HTML around the tag.

Is there any reason I should not do this? Is there a more elegant way of supporting both default and custom menus?

Thanks for reading.

share|improve this question

Use 'container' => false, in your wp_nav_menu array

share|improve this answer
Ah, yes, false, not a null value. Turns out there was an extra div in the default format that was dropped with custom menus. I got the same basic hierarchy with container_class => 'menu'. – dooley Jun 16 '11 at 0:28

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.