확장 워커 메뉴로 내 WordPress 메뉴를 만들었습니다. DIV 래핑 된 서브 메뉴의 첫 번째 레벨 주변이 필요합니다. 이미 작동 중입니다. 여기 내 코드입니다 :WordPress의 하위 메뉴에서 DIV를 어떻게 감쌀 수 있습니까? 첫 번째 수준에서만 가능합니까?
class SH_Child_Only_Walker extends Walker_Nav_Menu {
function start_lvl(&$output, $depth = 0, $args = array()) {
$indent = str_repeat("\t", $depth);
$output .= "\n$indent<div class=\"submenu\"><ul class=\"sub-menu\">\n";
}
function end_lvl(&$output, $depth = 0, $args = array()) {
$indent = str_repeat("\t", $depth);
$output .= "$indent</ul>\n<span class=\"subtoggle\"></span></div>\n";
}
그러나 여기에서 나는이 또한 깊은 레벨에서 모든 하위 메뉴 주위 wrappped DIV 얻을.
난 그냥이 방법이 필요합니다
첫 번째 레벨 : 메인 메뉴
두번째 레벨 (DIV없이) 하위 메뉴 :
세 번째 레벨 (DIV)와 하위 메뉴
어떻게 확장 워커 메뉴를 사용하여이를 수행 할 수 있습니까? jQuery 나 JavaScript를 사용하고 싶지 않다.
감사합니다.