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 opened
asOff
then 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 opened
asOn
then 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_walker
and itsstart_lvl
method. It seemingly uses a different method to generate the css class from the “Navigation Label” than whatwp_nav_menu
uses. Thestart_lvl
method usessanitize_key
, perhaps it should usesanitize_title
instead, or some other method.
- The topic ‘incorrect menu classes’ is closed to new replies.