0

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'  
) );
  • Make sure you are calling the correct menu, and a menu was actually set up for that theme_location. – fuxia 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? – fuxia Oct 30 '13 at 8:54
  • 1
    No, that’s not a problem. It is impossible. – fuxia Oct 30 '13 at 9:10
-2

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'          => ''
    ));
  • 3
    This is wrong, you should use a proper theme_location. – fuxia 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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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