Right…
The theme hooks into WordPress’s wp_nav_menu_args filter and, unless the menu being produced has a menu_id
of “mobile-menu”, changes the “walker” to its own.
WordPress has a Walker
class that is a general class for producing lists (which is all a menu is). WordPress also has a Walk_Nav_Menu
class, which extends the Walker
class specifically for menus. Usually plugins will provide their own “walker” as an extension of the WordPress Walker_Nav_Menu
class. This is exactly what CMW does : it uses its own extension of the Walker_Nav_Menu
class to do the filtering and set extra classes.
However, because your theme is intercepting every production of a menu and changing the requested “walker” class to its own, the CMW one never gets called. You’d probably find that other menu plugins (that have their own “walker”) would have exactly the same problem.
The theme code responsible can be found in tower/includes/core/codeless_megamenu.php
, as part of the codeless_custom_menu
class. The class is included into, and instantiated by, the theme’s functions.php
as part of the theme setup. With the sole exception of the mobile menu that activates from the burger button (when the screen is small enough), every menu produced using WordPress’s wp_nav_menu()
function will use the theme’s “walker”. (And even the exception isn’t really an exception : it’s just configured to use another of the theme’s “walkers”.)
I can guess what your next question will be : Is there a way around it?
By modifying CMW : No.
By modifying your theme : Yes. Add a check for $args[‘_custom_menu_wizard’] before deciding to switch over to the theme’s “walker”. However, this would be a change to the theme’s core code, and it would be lost (or would have to be re-applied) whenever the theme got updated! I would not advise changing any theme’s core code. If you have a child theme then that might be a different matter, but it would still mean that any theme update would have to be checked against your child theme modifications to ensure compatibility.
My suggestion : try dumping it in the theme provider’s lap?
I hope this helps.