Узнайте правильный ответ, авторизовавшись через социальные сети
Ответ на вопрос: "How can the class name of a sub-menu be changed in the wp_nav_menu?", который можно встретить среди вопросов викторины: "Upwork WordPress Test 2018"
- By manually adding the class name in Appearance—>Menus
- WordPress does not support the ability to change the class name of a sub-menu in the wp_nav_menu.
- By adding the following code in functions.php: class UL_Class_Walker extends Walker_Nav_Menu { function start_lvl(&$output, $depth) { $indent = str_repeat(«\t», $depth); $output .= «\n$indent<ul class=\»level-«.$depth.»\»>\n»; } }
- By adding the following code in header.php: class UL_Class_Walker extends Walker_Nav_Menu { function start_lvl(&$output, $depth) { $indent = str_repeat(«\t», $depth); $output .= «\n$indent<ul class=\»level-«.$depth.»\»>\n»; } }
Ответ на вопрос добавлен: 2018-11-03 21:07:49