我正在使用以下代码在我正在构建的WordPress主题中生成一个菜单。每次我访问一个页面时,菜单中该页面的链接都会被删除。
<?php
/**
* Displays a navigation menu
* @param array $args Arguments
*/
$args = array(
\'theme_location\' => \'primary\',
\'menu\' => \'\',
\'container\' => \'\',
\'container_class\' => \'\',
\'container_id\' => \'\',
\'menu_class\' => \'\',
\'menu_id\' => \'\',
\'echo\' => true,
\'fallback_cb\' => \'custom_menu\',
\'before\' => \'\',
\'after\' => \'\',
\'link_before\' => \'\',
\'link_after\' => \'\',
\'items_wrap\' => \'<ul id = "nav" class = "">%3$s</ul>\',
\'depth\' => 0,
\'walker\' => \'\'
);
wp_nav_menu( $args );
?>
</div>