实现方法
1、添加到css到style.css
#header .toggle-tougao{background:transparent;font-size:15px;border:1px solid #337ab7;border-radius:40px;padding:5px 16px;line-height:1;color:#337ab7;margin-right:10px;}#header .toggle-tougao:hover{background:#282828;border-color:#282828;color:#FFF;}#header .toggle-login{font-size:15px;}#header span.line{height:12px;display:inline-block;margin:0 5px;border-right:1px solid #E5E5E5;}
2、打开header.php文件查找代码:
<button class="js-toggle-search"><i class=" icon-search"></i></button>
在后加入代码:
<a href="<?php bloginfo('url'); ?>/contribute-page" class="toggle-tougao hidden-xs hidden-sm">投稿</a><?php if ( is_user_logged_in()){ echo '<a href="' .wp_logout_url( home_url() ). '" rel="nofollow" title="登出?">注销</a>';}else{ echo '<a href="'.get_settings('siteurl').'/wp-login.php" class="toggle-login hidden-xs hidden-sm">登录</a><span class="line hidden-xs hidden-sm"></span><a href="'.get_settings('siteurl').'/wp-login.php?action=register" class="toggle-login hidden-xs hidden-sm">注册</a>';} ?>
效果图
Grace7.0购买
发表评论