我在自定义WP主题中添加了一个菜单,这一切都很好用。但是,当我刷新页面时,有时会在菜单中显示一个额外的空白标题。有没有解决这个问题?我做错了吗?
以下是我所说的图片:
http://oi48.tinypic.com/t9d1xy.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>
</div>