我有wordpress的自定义主题。但我没有看到
中的end_lvl函数结果class Walker_menu_footergo extends Walker_Nav_Menu {
function start_lvl(&$output, $depth = 0, $args = array()) {
$output.= "<ul>";
}
function end_lvl(&$output, $depth = 0, $args = array()) {
$output.= '<li><a href="javascript:;" data-target="#rgister-rooftop" data-toggle="modal" href="#rgister-rooftop" class="hvr-overline-from-center menu-item menu-item-type-custom menu-item-object-custom "><span>Register Your Rooftop</span></a></li></ul>';
}
function start_el(&$output, $item, $depth = 0, $args = array()) {
if ($depth == 0)
$hvr_class = 'hvr-overline-from-center';
else
$hvr_class = '';
if (in_array('current-menu-item', $item ->classes)) {
$output.= "<li ><a class='current '".implode(' ', $item ->classes)." ' href='".$item ->url."'><span>".esc_attr($item ->title).'</span></a>';
} else {
$output.= "<li ><a class='".$hvr_class.' '.implode(' ', $item ->classes)." ' href='".$item ->url."'><span>".esc_attr($item ->title).'</span></a>';
}
}
}
footer.php中的我已经调用了这个函数
$footmenu=array('menu'=>'footer','menu_id'=>'','menu_class'=>'foot-menu','container'=>'ul','depth' => 0,'walker' => new Walker_menu_footergo());
<?php echo wp_nav_menu($footmenu); ?>
它返回除end_lvl函数之外的所有结果