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

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

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
up vote 0 down vote accepted

You should use

'container_class' => 'nav', 

instead of

'container-class' => 'nav', 

You can check out the parameters here:

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

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

 
discard

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.