3
votes

When I add a custom menu to my theme via a widget I get this line of code:

<ul id="menu-insurance" class="menu"><li id="menu-item-294" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-294"><a href="http://test">test</a></li>

I need to remove the class="menu", but I can not figure out how this is getting added to my custom menu when I use a widget. This style is creating style issues in my theme.

How can I remove the class="menu" from this widget?

My register sidebar is like this, I am not sure if it is doing it or if the wordpress code looks for css styling for menu when you use the custom menu widget:

     register_sidebar(array(
    'id' => 'sidebar',
    'name' => __('Main Sidebar'),
    'description' => __('Sidebar used on most pages'),
    'before_widget' => '<div id="%1$s" class="widget %2$s">',
    'after_widget' => '</div>',
    'before_title' => '<h2>',
    'after_title' => '</h2>',

));
1

1 Answers

1
votes

The custom menus are (or should be) created in functions.php inside your them. Find a piece of code like this one, and check or add the menu_class parametter and set to "".

wp_nav_menu(array(
    'container' => false,                           // remove nav container
    'container_class' => 'menu clearfix',           // class of container 
    'menu' => 'The Main Menu',                      // nav name
    'menu_class' => 'top-nav clearfix',             // This is it!!!
    'theme_location' => 'main-nav',                 
    'before' => '',                                 // before the menu
    'after' => '',                                  // after the menu
    'link_before' => '',                            // before each link
    'link_after' => '',                             // after each link
    'depth' => 0,                                   // limit the depth of the nav
    'show_home'   => '1',                           // show home link
    'fallback_cb' => 'bones_main_nav_fallback'      // fallback function
));