incorrect menu classes
-
The menu (css) classes are in some circumstances generated inconsistently/incorrectly.
Assume you have a menu item with a “Navigation Label” with a space, e.g. “Fast Faster”.
If you specify the theme option
Menu Settings/Mobile Menu Options/Submenu items collapse until openedasOffthen the menu item’s css class will bemenu-fast-faster– notice how the space in the “Navigation Label” is replaced with a dash. (The menu item also get other css classes, e.g.menu-item-14.)However, if you specify the theme option
Menu Settings/Mobile Menu Options/Submenu items collapse until openedasOnthen the menu item’s css class will bemenu-fastfaster– notice how the space in the “Navigation Label” is removed rather than replaced with a dash.This causes problems if you want to target the menu item using the menu class – the menu item in the mobile menu will be different than the menu item in the regular menu.
A likely cause is the class
kadence_mobile_walkerand itsstart_lvlmethod. It seemingly uses a different method to generate the css class from the “Navigation Label” than whatwp_nav_menuuses. Thestart_lvlmethod usessanitize_key, perhaps it should usesanitize_titleinstead, or some other method.
The topic ‘incorrect menu classes’ is closed to new replies.
