我想增加导航菜单的深度,因为它只显示到第三级。当前为wp\\U导航代码:
<?php wp_nav_menu( array( \'theme_location\' => \'main_menu\', \'container_id\' => \'navbar-collapse-1\',
\'container_class\'=>\'navbar-collapse collapse navbar-right\',
\'menu_class\'=>\'nav navbar-nav\',
\'fallback_cb\'=>false,
\'items_wrap\' => \'%3$s\',
\'container\'=>false,
\'walker\'=> new Bunch_Bootstrap_walker()
) ); ?>
我还尝试添加以下深度,但什么都没有发生:
<?php wp_nav_menu( array( \'theme_location\' => \'main_menu\', \'container_id\' => \'navbar-collapse-1\',
\'container_class\'=>\'navbar-collapse collapse navbar-right\',
\'menu_class\'=>\'nav navbar-nav\',
\'fallback_cb\'=>false,
\'items_wrap\' => \'%3$s\',
\'container\'=>false,
\'depth\'=>\'6\',
\'walker\'=> new Bunch_Bootstrap_walker()
) ); ?>
SO网友:benny-ben
深度必须是整数,请尝试以下操作:
<?php wp_nav_menu( array(
\'theme_location\' => \'main_menu\',
\'container_id\' => \'navbar-collapse-1\',
\'container_class\'=> \'navbar-collapse collapse navbar-right\',
\'menu_class\' => \'nav navbar-nav\',
\'fallback_cb\' => false,
\'items_wrap\' => \'%3$s\',
\'container\' => false,
\'depth\' => 6,
\'walker\' => new Bunch_Bootstrap_walker()
) ); ?>
发件人
codex:
depth (int)要包括的层次结构级别。0表示全部。默认值0