wordpress柒比贰主题美化:7B2主题 右上角 增加搜索按钮,修改发布图标:
在子主题的function.php文件中,增加下放代码。重新定义顶部菜单。本着不修改原有主题的原则。
原教材:7B2主题 右上角 投稿美化+加上搜索
本教程基于原教程只修改了图片样式和增加了搜索按钮。仅提供一个思路。具体原教程的全部效果。需要您完善一下
//顶部菜单
if ( ! function_exists( 'header_top_menu_7b2' ) ) {
function header_top_menu_7b2(){
$is_login = is_user_logged_in();
$shop_show = zrz_get_display_settings('shop_show');
$tx_admin = zrz_get_credit_settings('zrz_tx_admin');
?>
<div class="sign-button pos-r pos-a"> if($is_login){
$this_user = wp_get_current_user();
?><div class="sign-button-r mar10-r mobile-hide">
<button class="sousuo text" @click="showSearchBox('search')"><i class="iconfont zrz-icon-font-sousuo">i><br>button>
<button class="head-vip text" @click="showWriteBox"><i class="zrz-icon-font-write1 iconfont">i>button>
if($shop_show){ ?><a class="button text pos-r" href="" ref="addToCart"><i class="zrz-icon-font-haofangtuo400iconfont2gouwu iconfont">i><span v-text="shopCount" class="pos-a" v-if="shopCount > 0">span>a>
} ?>div><span class="mouh text click" @click.stop="showUserMenu"> echo get_avatar($this_user->ID,'60'); ?><span v-cloak><span class="pos-a fs12 hd-tips" v-show="msgCount > 0">span>span>span>
<div :class="['user-login-menu','pos-a','pjt','transform-out',showMenu ? 'transform-in' : '']" v-cloak><a class="b-b pd10" href="ID); ?>"> echo get_avatar($this_user->ID,'60'); ?><div class="user-home-link"> echo $this_user->display_name; ?><p class="fs12 gray"> echo __('个人主页','7b2'); ?>p>div>a><div class="mobile-icon hide b-b"><button class="head-vip text" @click="showWriteBox"><i class="zrz-icon-font-dengpao iconfont">i> 发起button><span class="dot">span>
if($shop_show){ ?><a class="button text pos-r" href="" ref="addToCart"><i class="zrz-icon-font-haofangtuo400iconfont2gouwu iconfont">i><span v-text="shopCount" class="pos-a" v-if="shopCount > 0">span>购物车a>
} ?>div><a href="" class="hd-avatar"><i class="zrz-icon-font-icon_message iconfont">i> echo __('消息','7b2'); ?><span class="fs12" v-text="msgCount" v-show="msgCount > 0">span>a>
<a href=""><i class="zrz-icon-font-wodesixin iconfont">i> echo __('私信','7b2'); ?>a><a href=""><i class="zrz-icon-font-cny iconfont">i> echo __('财富','7b2'); ?>a><a href=""><i class="zrz-icon-font-huiyuan iconfont">i>付费会员a>
<a class="b-b" href="ID.'/setting'); ?>"><i class="zrz-icon-font-setting1 iconfont">i> echo __('编辑个人资料','7b2'); ?>a> if($tx_admin == $this_user->ID){ ?><a href=""><i class="zrz-icon-font-tixian iconfont">i> echo __('提现管理','7b2'); ?>a> } ?> if(current_user_can('delete_users')){ ?><a href=""><i class="zrz-icon-font-setting1 iconfont">i> echo __('进入后台','7b2'); ?>a> } ?><a href=""><i class="zrz-icon-font-tuichu iconfont">i> echo __('登出','7b2'); ?>a>div> }else{ ?><div class="mobile-button"><button class="text" @click.stop="sign('in')"><i class="iconfont zrz-icon-font-40one">i>button>
div>
<div class="mobile-hide"><button class="empty" @click="sign('in')" v-cloak>登录button>
<button class="small mar10-l" @click="sign('up')" v-if="canReg == 1" v-cloak>快速注册button>
div>
} ?>div>
}
}