多应用+插件架构,代码干净,二开方便,首家独创一键云编译技术,文档视频完善,免费商用码云13.8K 广告
~~~ <?php /* *@type string $menu 后台导航分类的名称或id *@type string $menu_class 导航ul的类,默认值'menu'. *@type string $menu_id 导航ul元素的id *@type string $container 包括导航ul的标签默认为div *@type string $container_class 包括导航ul标签的class默认为空 *@type string $container_id 包括导航ul标签的id默认为空 *@type callable|bool $fallback_cb 如果菜单不存在则启用的返回函数'wp_page_menu'. *@type string $before 导航A标签之前 *@type string $after 导航A标签之后 *@type string $link_before 导航链接名之前 *@type string $link_after 导航链接名之后 *@type bool $echo 是否输入,false则为赋值 *@type int $depth 调用层级,默认为0调用所有 *@type object $walker 调用一个对象定义显示导航菜单 *@type string $theme_location 指定显示的导航名,如果没有设置,则显示第一个 *@type string $items_wrap 导航列表的包括标签默认是带有id和class的ul通过sprintf输出 * */ $menu_args = array( //最外层容器的标签名,默认div 'container' => 'div', //最外层容器的class名 'container_class' => 'mainNavBlock', //最外层容器的id名 'container_id' => 'menu', //导航菜单ul标签的class名 'menu_class' => 'mainNav', //导航菜单ul标签的id名 'menu_id' => 'nav', //是否打印,默认是true,如果想将导航的代码作为赋值使用,可设置为false 'echo' => true, //备用的导航菜单函数,用于没有在后台设置导航时调用 'fallback_cb' => 'the_main_nav', //显示在导航a标签之前 'before' => '', //显示在导航a标签之后 'after' => '', //显示在导航链接名之前 'link_before' => '', //显示在导航链接名之后 'link_after' => '', //显示的菜单层数,默认0,0是显示所有层 'depth' => 0, //调用一个对象定义显示导航菜单 'walker' => new Walker_Nav_Menu(), //指定显示的导航名,如果没有设置,则显示第一个 'theme_location' => 'primary' ); ?> ~~~