php WPMU DEV自动导航菜单

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了php WPMU DEV自动导航菜单相关的知识,希望对你有一定的参考价值。

wpmu_list_pages() {
 
	$args = array(
		'depth' => 2
	);

	wp_list_pages( $args );

}
wp_list_pages( $args );
wpmu_list_pages() {
 
	$args = array(
		'depth' => 2
	);

}
<?php wp_nav_menu( array(
		'theme_location' => 'top',
		'menu_id'        => 'top-menu',
	) ); ?>
/*
Theme Name:     WPMU DEV Automated Navigation Menus
Theme URI:      https://github.com/rachelmccollin/wpmudev-automated-menus
Description:    Theme to support WPMU DEV post on automating navigation and section menus. Child theme for the Twenty Seventeen theme.
Author:         Rachel McCollin
Author URI:     http://rachelmccollin.co.uk/
Template:       twentyseventeen
Version:        1.0
*/

@import url("../twentyseventeen/style.css");
<?php
/**
 * Plugin Name: WPMU DEV Automated Navigation Menus
 * Plugin URI: https://github.com/rachelmccollin/wpmudev-automated-menus
 * Description: Plugin to accompnay WPMU DEV post on automating navigation and section menus
 * Version: 1.0
 * Author: Rachel McCollin
 * Author URI: http://rachelmccollin.co.uk
 *
 */
<?php 
	
	if ( function_exists( 'wpmu_list_pages' ) ) {
		wpmu_list_pages();
	}
	
	else {
		wp_nav_menu( array(
			'theme_location' => 'top',
			'menu_id'        => 'top-menu',
		) );
	} 
	
	?>
$args = array(
	'depth' => 2,
	'title_li' => '<h3>' . __( 'Menu', 'wpmu' ) . '</h3>',
	'sort_column' => 'menu-order'
);
$args = array(
	'depth' => 2
);

以上是关于php WPMU DEV自动导航菜单的主要内容,如果未能解决你的问题,请参考以下文章

php 在WPMU DEV Google Maps Add-on中将地理标记限制从硬集6更改为无限制

text 用于WordPress的WPMU DEV Defender IP白名单

PHP 如何自动将搜索字段添加到导航菜单中| WordPress的

Wordpress 如何在导航菜单中删除自动生成的

如何在自定义 PHP 脚本中调用 WordPress 函数

WPMU-Can&ŧ039;t在侧边栏小部件中插入脚本