网站右上角的登录,头像,如何删除或者添加删减。
首先,先创建注册,跟登录模板,取名login跟register,重要,重要,重要!
确认https://网址/login 跟https://网址/register 能访问打开才能开始动手
我们打开主题内的inc文件夹的theme_plus.php文件第496行发现以下代码:
<div class="herder-user-name no-logged"> <a href="<?php echo $login_url; ?>" target="_blank" style="color:<?php echo akina_option('theme_skin'); ?>;font-weight:bold;text-decoration:none">登录</a>
|
在其后添加:
<br><a href="你的鏈接網址" target="_blank" style="color:<?php echo akina_option('theme_skin'); ?>;font-weight:bold;text-decoration:none">文字</a>
|
打开后台-主题设置-后台配置-填上资料
下面我们来看看登录后的删减
打开主题内的inc文件夹的theme_plus.php文件约478-481行
<a href="<?php bloginfo('url'); ?>/wp-admin/" target="_blank"><?php _e('Dashboard','sakurairo')?></a> <a href="<?php bloginfo('url'); ?>/wp-admin/post-new.php" target="_blank"><?php _e('New post','sakurairo')?></a> <?php } ?> <a href="<?php bloginfo('url'); ?>/wp-admin/profile.php" target="_blank"><?php _e('Profile','sakurairo')?></a> <a href="<?php echo wp_logout_url(get_bloginfo('url')); ?>" target="_top"><?php _e('Sign out','sakurairo')?></a>
|
把不需要的一行删除掉,例如我不需要撰写文章 ,直接注释或删除!
刪除掉代碼 :<a href="<?php bloginfo('url'); ?>/wp-admin/post-new.php" target="_blank"><?php _e('New post','sakurairo')?></a>
|
但是有的人想直接不要登录呢,现在来看看如何删除掉
大约在470-500中间的以下代码删除掉或注释掉
<div class="header-user-avatar"> <img class="faa-spin animated-hover" src="<?php echo get_avatar_url( $current_user->ID, 64 );/*$ava;*/ ?>" width="30" height="30"> <div class="header-user-menu"> <div class="herder-user-name">当前已登录 <div class="herder-user-name-u"><?php echo $current_user->display_name; ?></div> </div> <div class="user-menu-option"> <?php if (current_user_can('level_10')) { ?> <a href="<?php bloginfo('url'); ?>/wp-admin/" target="_blank"><?php _e('Dashboard','sakurairo')?></a> <a href="<?php bloginfo('url'); ?>/wp-admin/post-new.php" target="_blank"><?php _e('New post','sakurairo')?></a> <?php } ?> <a href="<?php bloginfo('url'); ?>/wp-admin/profile.php" target="_blank"><?php _e('Profile','sakurairo')?></a> <a href="<?php echo wp_logout_url(get_bloginfo('url')); ?>" target="_top"><?php _e('Sign out','sakurairo')?></a> </div> </div> </div> <?php }else{ $ava = akina_option('webweb_img').'/ui/none.png'; $login_url = akina_option('exlogin_url') ? akina_option('exlogin_url') : get_bloginfo('url').'/wp-login.php'; ?> <div class="header-user-avatar"> <a href="<?php echo $login_url; ?>"> <img class="faa-shake animated-hover" src="<?php echo $ava; ?>" width="30" height="30"> </a> <div class="header-user-menu"> <div class="herder-user-name no-logged"> <a href="<?php echo $login_url; ?>" target="_blank" style="color:<?php echo akina_option('theme_skin'); ?>;font-weight:bold;text-decoration:none">登 录</a> <br><br><a href="/register" target="_blank" style="color:<?php echo akina_option('theme_skin'); ?>;font-weight:bold;text-decoration:none">註 冊</a> </div> </div> </div>
|
已经去掉了。是不是美哒哒!