所以我在我的自定义 WP 主题中添加了一个菜单,这一切都很好。但是,当我刷新页面时,菜单中会出现一个额外的空白标题。有解决办法吗?我做错什么了吗?
这是我正在谈论的图像:http: //oi46.tinypic.com/17txc8.jpg
<div id="navbar">
<?php wp_nav_menu( array( 'menu' => 'Primary Menu', 'container' => false,'menu_id' => 'main-nav','depth'=>'2')); ?>
<div id="login" >
<?php if (!(current_user_can('level_0'))){ ?>
<form name="loginform" id="loginform" action="<?php echo get_option('siteurl'); ?>/wp-login.php" method="post">
<input value="Username" class="input" type="text" tabindex="10" name="log" id="user_login" style="padding-left: 2px;" onfocus="if (this.value == 'Username') {this.value = '';}" onblur="if (this.value == '') {this.value = 'Username';}" />
<input value="Password" class="input" type="password" tabindex="20" name="pwd" id="user_pass" style="padding-left: 2px;" onfocus="if (this.value == 'Password') {this.value = '';}" onblur="if (this.value == '') {this.value = 'Password';}" />
<input name="wp-submit" id="wp-submit" tabindex="100" value=" " type="submit" class="loginbutton" >
<input name="redirect_to" value="<?php echo get_option('siteurl'); ?>" type="hidden">
<input name="testcookie" value="1" type="hidden">
</form>
<a class="helpbutton" href="<?php echo get_option('home'); ?>/wp-login.php?action=lostpassword"></a>
<?php } else { ?>
<ul class="admin_box">
<li><a href="<?php echo get_option('home'); ?>/wp-admin/">Dashboard</a></li>
<li><a href="<?php echo get_option('home'); ?>/wp-admin/post-new.php">Write New Post</a></li>
<li><a href="<?php echo get_option('home'); ?>/forums">Forums</a></li>
<li><a href="<?php echo wp_logout_url('$index.php'); ?>">Log out</a></li>
</ul>
<?php }?>
</div>
</div>