Just playing around with adding “custom menu” support to my theme. I’m super excited about it.
HOWEVER,
Check this out >
<ul id="menu-my-main-menu" class="menu">
<li id="menu-item-12"
class="menu-item menu-item-type-custom menu-item-object-custom current-menu-item current_page_item menu-item-home menu-item-12">
<a href="http://localhost/bizsite">Home</a>
</li>
</ul>
Worst case of “class-itus” I think I’ve ever seen. Is this something “I” did unintentionally or is this the default?
How can I control or remove the class attribs on these menus?
You can use the
nav_menu_css_class
filter to remove the classes that you want from your menu-item.See the example below, to remove ALL the CSS classes that are appended to you menu items:
Do a
print_r($classes)
if you want to know which classes are active in your menu.