VAN子主题优化记录(自用修改后)

交易弹幕

随机彩色背景

wp-content/themes/van/assets/js/barrage/barrage.js,第16行

M.bgColors = ['#f79a3e','#e66760','#5382af',' #aea79f','#37b8af','#008b5d',' #f0b849','#499df3',' #5f6c72',' #8c88cd'];

弹幕文字上下不居中

wp-content/themes/van/assets/css/footer/footer.css,更改为30px

#van-barrage li {
    display: flex;
    opacity: 0;
    border-radius: 20px;
    color: #fff;
    padding: 3px 10px 30px 3px;
    clear: both;
    font-size: 13px;
    height: 26px;
    float: right;
    line-height: 26px;
}

滚动条美化

/wp-content/themes/van/assets/css/beautify/scrollbar.css

::-webkit-scrollbar {
/*滚动条整体样式,红色窄条*/
width: 5px; 
/*高宽分别对应横竖滚动条的尺寸*/
/*height: 5px;*/
}
::-webkit-scrollbar-thumb {
/*滚动条里面小方块*/
background-color: #ee3f4d;
/*background-image: -webkit-linear-gradient(45deg, rgba(255, 93, 143, 1) 25%, transparent 25%, transparent 50%, rgba(255, 93, 143, 1) 50%, rgba(255, 93, 143, 1) 75%, transparent 75%, transparent);*/
}
::-webkit-scrollbar-track {
/*滚动条里面轨道*/
-webkit-box-shadow: inset 0 0 5px rgba(0,0,0,0.2);
background: #fff;
}

悬浮登录框

wp-content/themes/van/template-parts/footer/footer_login.php

文字加粗加钻石

<strong><a rel="nofollow" href="<?php echo $post_data['post_name']; ?>" title="VIP" target="<?php echo $van_foot_float_set['_blank']; ?>">
    	    <i class="fa fa-diamond"></i>开通<?php echo $van_foot_float_set['_vip_name']; ?></a><?php echo $van_foot_float_set['_text'];?></strong>

背景渐变

wp-content/themes/van/assets/css/footer/footer_login.css

.van_slogin {
	position: fixed;
	z-index: 99;
	left: 0;
	bottom: 0;
	width: 100%;
	padding: 20px 0;
	text-align: center;
	height: auto;
	line-height: 45px;
	font-family: microsoft yahei;
	transition: All 0.5s ease-in-out;
	-webkit-transition: All 0.5s ease-in-out;
	-moz-transition: All 0.5s ease-in-out;
	-o-transition: All 0.5s ease-in-out;
	background: linear-gradient(to right,#fdf7e3, #ffefba );
}

文字变红

wp-content/themes/van/assets/css/footer/footer_login.css

.van_slogin_info a {
	color: #ff0076;
	-webkit-animation: hue 6s infinite linear;
}

首页修改

统计模块顶端距离修改

wp-content/themes/van/assets/css/van_home_gadgets.css

 .van-statistics-widget {
    background: #fff;
    padding: 0 ;
    margin-top: 0;
}

footer.php文件修改,改变网站右键样式及加浮窗广告

<!-- 右键美化 by 主题屋 -->
<style type="text/css">
    a {text-decoration: none;}
    div.usercm{background-repeat:no-repeat;background-position:center center;background-size:cover;background-color:#fff;font-size:13px!important;width:130px;-moz-box-shadow:1px 1px 3px rgba
(0,0,0,.3);box-shadow:0px 0px 15px #333;position:absolute;display:none;z-index:10000;opacity:1; border-radius: 5px;}
    div.usercm ul{list-style-type:none;list-style-position:outside;margin:0px;padding:0px;display:block}
    div.usercm ul li{margin:0px;padding:0px;line-height:35px;}
    div.usercm ul li a{color:#666;padding:0 15px;display:block}
    div.usercm ul li a:hover{color:#fff;background:#28a745}
    div.usercm ul li a i{margin-right:10px}
    a.disabled{color:#c8c8c8!important;cursor:not-allowed}
    a.disabled:hover{background-color:rgba(255,11,11,0)!important}
    div.usercm{background:#fff !important;}
    </style>
<div class="usercm" style="left: 199px; top: 5px; display: none;">
    <ul>
        <li><a href="https://mmsto.com/winmac/"><i class="fa fa-home fa-fw"></i><span>首页</span></a></li>
        <li><a href="javascript:void(0);" onclick="getSelect();"><i class="fa fa-copy fa-fw"></i><span>复制</span></a></li>
        <li><a href="javascript:history.go(1);"><i class="fa fa-arrow-right fa-fw"></i><span>前进</span></a></li>
        <li><a href="javascript:history.go(-1);"><i class="fa fa-arrow-left fa-fw"></i><span>后退</span></a></li>
        <li style="border-bottom:1px solid gray"><a href="javascript:window.location.reload();"><i class="fa fa-spinner fa-spin fa-fw"></i><span>刷新</span></a></li>        
        <li><a href="javascript:void(0);"  onclick="baiduSearch();"><i class="fa fa-paw fa-fw"></i><span>百度</span></a></li>
        <li><a href="javascript:void(0);" onclick="sougouSearch();"><i class="fa fa-search fa-fw"></i><span>搜狗</span></a></li>
        <li><a href="javascript:void(0);" onclick="googleSearch();"><i class="fa fa-google fa-fw"></i><span>谷歌</span></a></li>
     </ul>
</div>
<script type="text/javascript">
    (function(a) {
        a.extend({
            mouseMoveShow: function(b) {
                var d = 0,
                    c = 0,
                    h = 0,
                    k = 0,
                    e = 0,
                    f = 0;
                a(window).mousemove(function(g) {
                    d = a(window).width();
                    c = a(window).height();
                    h = g.clientX;
                    k = g.clientY;
                    e = g.pageX;
                    f = g.pageY;
                    h + a(b).width() >= d && (e = e - a(b).width() - 5);
                    k + a(b).height() >= c && (f = f - a(b).height() - 5);
                    a("html").on({
                        contextmenu: function(c) {
                            3 == c.which && a(b).css({
                                left: e,
                                top: f
                            }).show()
                        },
                        click: function() {
                            a(b).hide()
                        }
                    })
                })
            },
            disabledContextMenu: function() {
                window.oncontextmenu = function() {
                    return !1
                }
            }
        })
    })(jQuery);
 
    function getSelect() {
        "" == (window.getSelection ? window.getSelection() : document.selection.createRange().text) ? layer.msg("请选择需要百度的内容!") : document.execCommand("Copy")
    }
    function baiduSearch() {
        var a = window.getSelection ? window.getSelection() : document.selection.createRange().text;
        "" == a ? layer.msg("请选择需要百度的内容!") : window.open("https://www.baidu.com/s?wd=" + a)
    }
    function sougouSearch() {
        var a = window.getSelection ? window.getSelection() : document.selection.createRange().text;
        "" == a ? layer.msg("请选择需要搜狗的内容!") : window.open("https://www.sogou.com/web?query=" + a)
    }
    function googleSearch() {
        var a = window.getSelection ? window.getSelection() : document.selection.createRange().text;
        "" == a ? layer.msg("请选择需要谷歌的内容!") : window.open("https://www.google.com/search?q=" + a)
    }
    $(function() {
        for (var a = navigator.userAgent, b = "Android;iPhone;SymbianOS;Windows Phone;iPad;iPod".split(";"), d = !0, c = 0; c < b.length; c++) if (0 < a.indexOf(b[c])) {
            d = !1;
            break
        }
        d && ($.mouseMoveShow(".usercm"), $.disabledContextMenu())
    });
</script>
<!-- 右键美化结束 by 主题屋 -->

<?php 
// 给网站添加悬浮动画广告
// 教程地址:https://www.cpon.cn/19605.html
// 你猜这是干什么的
$vip_type = _get_user_vip_type($current_user->ID);
// 判断当前用户是否为vip / 永久vip
if($vip_type != 'vip'){
if ($vip_type != 'boosvip'){
// 不是则输出以下代码
echo '<div class="showpc"><style>.showpc{display:none;}@media (min-width:960px){.showpc{display:inline;}}</style><div id="wpon_svip_gif" class="wpon_svip_gif" style="display: block;">
<div class="kubao" style="display: none;"></div><p><a class="link animated" href="https://mmsto.com/winmac/user/vip" data-stat="升级SVIP活动特价" target="_blank" style="border: none; box-shadow: none;"><br><img src="https://mmsto.com/winmac/wp-content/uploads/2022/03/1648723994-12c147e9f7d286d.png" height="160" width="100"><br></a></p></div></div>';}}?>

VAN主题侧边栏小工具不启用

启用的话会导致原本修改的html小工具(背景透明0边距)失效,functions.php里面注释掉即可

/**删除Van主题自带的侧边小工具
	wp_enqueue_style('van_widget_style', trailingslashit(get_stylesheet_directory_uri()) . 'assets/css/van_widget.css?van_ver=' . VAN_VER, array('plugins', 'app', 'dark'));
*/   
}

 

版权声明:
作者:老刘
链接:https://winmac.cn/van.html
来源:老刘的部落格
文章版权归作者所有,未经允许请勿转载。

THE END
分享
二维码
< <上一篇
下一篇>>
文章目录
关闭
目 录