基本上,您缺少容器div,因此如果您将回退更改为自定义函数,则可以将参数传递到wp\\u page\\u菜单,让您可以对其进行一些控制,并添加缺少的div try:
$wp_nav_header = array(
\'container\' => \'\',
\'menu_class\' => \'sf-menu\',
\'fallback_cb\' => \'my_fallback_menu\',
\'theme_location\' => \'primaryheader\',
\'depth\' => 0,);
wp_nav_menu( $wp_nav_header);
function my_fallback_menu(){
echo \'<div class="sf-menu">\';
$args = array(
\'sort_column\' => \'menu_order, post_title\',
\'menu_class\' => \'\',
\'include\' => \'\',
\'exclude\' => \'\',
\'echo\' => true,
\'show_home\' => false,
\'link_before\' => \'\',
\'link_after\' => \'\' );
wp_page_menu($args);
echo \'</div>\';
}
希望这有帮助