As you know, there are input boxes for CSS Classes (optional) on each menus.

But it's not showing (coming out) in source. Is there any function for disable for CSS Classes (optional)? I need to find it and remove it.

my another sites work fine like this. I put "navi_box1" on Menu1 as CSS Class. and it shows right spot.. <ul id="menu-menu-box" class="menu"><li id="menu-item-422" class="navi_box1 menu-item menu-item-type-custom menu-item-object-custom menu-item-422"><a href="/" class="has-submenu">Menu1</a> ..........etc....... </ul>

this is the codes for navi..

    wp_nav_menu( array( 'container' => false, 'menu_class' => 'left', 'theme_location' => 'primary', 'fallback_cb' => 'sweetdate_main_nav', 'walker'        => new sweetdate_walker_nav_menu) );

the name of theme_location is right.

  • 1
    Do you have menu assigned to this location? Jul 12 '13 at 12:13

The obvious answer is that sweetdate_walker_nav_menu, which is the walker that creates this menu, is written is such a way as to not print those classes. It is hard to say for sure without seeing the code for that custom walker but you can remove the 'walker' => new sweetdate_walker_nav_menu argument to verify that that is the problem. If it is you'd have to write code into the walker so that it uses those classes.

There is also a filter called nav_menu_css_class which I believe is what one would use to remove those classes. However, there are numerous other filters in nav-menu-template.php and nav-menu.php that could potentially be involved.

  • yes you are right. it's more complicated for me to fix.. I will try without sweetdate_walker_nav_menu. thanks.
    – pulla
    Jul 14 '13 at 14:14

You can use below code to your wp_nav_menu

'items_wrap' => '<ul class="%2$s">%3$s</ul>'

It is sometimes caused by some plugin, but you can edit it on live preview, on live editing customizer page:

Customizer -> Menu * &setting

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.