【发布时间】:2019-12-04 10:40:29
【问题描述】:
我是 wordpress 的新手,我正在创建自定义导航栏并且我通过了深度级别 3,但它总是返回 0, 请帮我找出错误
下面是我的代码和输出
wp_nav_menu(array(
'theme_location' => 'primary',
'walker' => new Walker_Nav_Menu_Page(),
'container' => 'ul',
'menu_class' => 'top-level',
'depth' => 4
));
function start_el(&$output, $item, $depth = 0, $args = array(), $id = 0)
{
var_dump($depth);
}
int(0)
int(0)
int(0)
int(0)
int(0)
int(0)
int(0)
int(0)
int(0)
int(0)
int(0)
int(0)
感谢任何解决方案!
【问题讨论】:
标签: php wordpress wordpress-theming