- How do I change the sub menu class in WordPress?
- How do I create a dynamic submenu in WordPress?
- How do I add a class to a menu item in WordPress?
- How do I get to menu in WordPress?
- How do I add a class to WP Nav menu li a href?
- How do I create a multi level menu in WordPress?
- How do I change a static menu to a dynamic menu in WordPress?
- How do I show primary menu in WordPress?
- How do I style a menu in WordPress?
- How do I get the header menu in WordPress?
How do I change the sub menu class in WordPress?
By this way, only one method needs to be overridden below is the code that you can use:
- class My_Walker_Nav_Menu extends Walker_Nav_Menu
- function start_lvl(&$output, $depth)
- $indent = str_repeat("\t", $depth);
- $output .= "\n$indent<ul class=\"my-sub-menu\"">