子主题中创建functions.php文件,加入以下代码:
function theme_setup() {
// This theme uses wp_nav_menu() in one location.register_nav_menu( 'secondary', __( 'Secondary Menu', 'theme' ) );
}
add_action( 'after_setup_theme', 'theme_setup' );
在调用菜单页面中加入:
<?php wp_nav_menu( array( 'theme_location' => 'secondary', 'menu_class' => 'footer-link' ) ); ?>