1. 主页
  2. 文档
  3. 搭建一个最简主题
  4. 配置functions.php
  5. 注册菜单

注册菜单

[cc]/**
* Register navigation menus uses wp_nav_menu in five places.
*/
function startwordpress_menus() {

$locations = array(
‘primary’ => __( ‘Primary Menu’, ‘startwordpress’ ),

‘footer’ => __( ‘Footer Menu’, ‘startwordpress’ ),

);

register_nav_menus( $locations );
}

add_action( ‘init’, ‘startwordpress_menus’ );[/cc]

这篇文章对您有用吗?

我们要如何帮助您?