Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I've styled my navigation menu with the classes of wp_nav_menu .menu_item , .sub_menu etc.When i added a new page suddenly the whole menu was ruined the classes where changed to .page_item, .children the ul was wrapped with a div container.I checked the code and the function wwas wp_nav_menu...What should I do to get the old menu style?

Edit

wp_nav_menu( array( 
    'theme_location' => 'main_menu', 
    'container' => '', 
    'menu_class' => 'menu'  
) );
share|improve this question
    
Make sure you are calling the correct menu, and a menu was actually set up for that theme_location. –  toscho Oct 30 '13 at 8:48
    
wp_nav_menu(array( 'theme_location' => 'main_menu', 'container' => '', 'menu_class' => 'menu' )); –  Antonio Papa Oct 30 '13 at 8:49
    
this way i called the menu –  Antonio Papa Oct 30 '13 at 8:50
    
Is a menu assigned to that location? –  toscho Oct 30 '13 at 8:54
1  
No, that’s not a problem. It is impossible. –  toscho Oct 30 '13 at 9:10
show 3 more comments

1 Answer

Found the answer i've added changed the wp_nav_menu args to this:

    wp_nav_menu(array(
        'theme_location'  => '',
        'menu'            => '',
        'container'       => '',
        'container_class' => '',
        'container_id'    => '',
        'menu_class'      => 'menu',
        'menu_id'         => '',
        'echo'            => true,
        'fallback_cb'     => 'wp_page_menu',
        'before'          => '',
        'after'           => '',
        'link_before'     => '',
        'link_after'      => '',
        'items_wrap'      => '<ul id="%1$s" class="%2$s">%3$s</ul>',
        'depth'           => 0,
        'walker'          => ''
    ));
share|improve this answer
3  
This is wrong, you should use a proper theme_location. –  toscho Oct 30 '13 at 10:03
    
no it doesnt work if i add a theme location :/ –  Antonio Papa Oct 30 '13 at 12:34
    
What, specifically, doesn't work if you add theme_location? What is the rendered output? What is the expected behavior? What is not happening as expected, or happening unexpectedly? –  Chip Bennett Oct 30 '13 at 12:47
    
Here is where i found the answer: wordpress.org/support/topic/… i had the same problems –  Antonio Papa Oct 30 '13 at 12:56
add comment

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.