Sign up ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I want to render a menu with a container like this:

<nav class="nav">

However, the container is just rendering with the default class name applied which I don't want.

<nav class="menu-main-nav-container">

I can't understand where I'm going wrong. Here's my code:

if ( has_nav_menu( 'nav-menu' ) ) { 
wp_nav_menu( array( 
'theme_location' => 'nav-menu', 
'container' => 'nav', 
'container-class' => 'nav', 
'items_wrap' => '<ul id="%1$s" class="clearfix %2$s">%3$s</ul>' ) );

Anyone able to help?

share|improve this question

1 Answer 1

up vote 0 down vote accepted

You should use

'container_class' => 'nav', 

instead of

'container-class' => 'nav', 

You can check out the parameters here:

share|improve this answer
Thank you! Been a while since I did any PHP and I've been doing this all evening. – Steph Mar 4 '13 at 10:39

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.