11、用户头像呼吸光环+鼠标悬停旋转放大

网站管理后台—>主题设置—>自定义代码—>自定义CSS样式 添加以下代码:

/*头像呼吸光环和鼠标悬停旋转放大开始*/
.avatar{border-radius: 50%; animation: light 4s ease-in-out infinite; transition: 0.5s;}.avatar:hover{transform: scale(1.15) rotate(720deg);}@keyframes light{0%{box-shadow: 0 0 4px #f00;} 25%{box-shadow: 0 0 16px #0f0;} 50%{box-shadow: 0 0 4px #00f;} 75%{box-shadow: 0 0 16px #0f0;} 100%{box-shadow: 0 0 4px #f00;}}
/*头像呼吸光环和鼠标悬停旋转放大结束*/

12、首页文章列表悬停上浮开始

网站管理后台—>主题设置—>自定义代码—>自定义CSS样式 添加以下代码:

/*首页文章列表悬停上浮开始*/
@media screen and (min-width: 980px){.tab-content .posts-item:not(article){transition: all 0.3s;}.tab-content .posts-item:not(article):hover{transform: translateY(-10px); box-shadow: 0 8px 10px rgba(255, 112, 173, 0.35);}}
/*首页文章列表悬停上浮结束*/

13、WordPress侧边栏添加滚动播报小工具两种样式

14、文章底部添加最后更新时间或过期失效提示

  • 分为三个步骤

1.将下面的 PHP 代码加入到主题目录下:themes/zibll/functions.php 文件中。

//文章过期提示开始
function article_time_update() {
    date_default_timezone_set('PRC');
    $newdate=time();
    $updated_date = get_the_modified_time('Y-m-d H:i:s');
    $updatetime=strtotime($updated_date);
    $custom_content = '';
    if ( $newdate > $updatetime+86400) {
    $custom_content= '<div class="article-timeout"><strong><i class="fa fa-bell" aria-hidden="true"></i> 温馨提示:</strong>本文最后更新于<code>'. $updated_date . '</code>,某些文章具有时效性,若有错误或已失效,请在下方<a href="#comment">留言</a>或联系<a target="_blank" title="觅知博客" href="http://wpa.qq.com/msgrd?v=3&uin=1426239465&site=qq&menu=yes"><b>觅知社长</b></a>。</div >';
    }
        echo $custom_content;
    }
//文章过期提示结束
  • 说明:请自己修改上面有关于自己网站的信息,改成自己网站信息即可,图标可以用阿里矢量图。

2.在主题目录themes/zibll/inc/functions/zib-single.php 文件中,文章分页函数(我的是在 322 行,因为我的代码有改动,所有不确定行数,见下图)下面添加下方代码即可。

  • PHP 代码:
article_time_update();//文章过期提示
子比主题美化教程-默语空间

3.CSS 代码:(在自定义 CSS 样式添加下面代码)

/*过期文章提示样式*/
.article-timeout{position:relative; border-radius: 8px; position: relative; margin-bottom: 25px; padding: 10px; background-color: var(--body-bg-color);}

15、一行代码实现全站变灰一般用于悼念缅怀日

16、在网站右侧边栏添加和风天气模块

后台设置—>外观—>小工具—>添加自定义 HTML 代码,加到合适侧边栏即可

<!--风天气模块-->
<div id="he-plugin-standard"></div>
<script>
WIDGET = {
  "CONFIG": {
    "layout": "2",
    "width": "285",
    "height": "300",
    "background": "1",
    "dataColor": "FFFFFF",
    "borderRadius": "5",
    "key": "3180d3c43e524753ab8bcef69dba023a"
  }
}
</script>
<script src="https://widget.qweather.net/standard/static/js/he-standard-common.js?v=2.0"></script>
<!--风天气模块-->

效果演示

子比主题美化教程-默语空间

17、网站文章底部添加【我也是有底线的+图片】

1、在后台子比主题设置—自定义 CSS 样式 添加以下代码:

#percentageCounter{position:fixed; left:0; top:0; height:3px; z-index:99999; background-image: linear-gradient(to right, #339933,#FF6666);border-radius:5px;}
/*底部可爱底线提示*/

2、在 zibll 主题目录下,themes/zibll/footer.php 文件中的“第一行”(重要)下面添加下面的代码:

<!--底部可爱底线提示-->
<div class="app_normal window" style="padding-top:" data-reactroot=""><div class="common_container lastpagenotice_noticewrap"><img src="https://z3.ax1x.com/2021/08/25/hZZUjU.png" data-spm-anchor-id="a2ha1.14919748_WEBHOME_GRAY.0.i1"><div class="lastpagenotice_text"  style="color:#6699FF;font-weight:bold;">我也是有底线哒~</div><div class="lastpagenotice_line"></div></div></div>
<!--底部可爱底线提示-->

18、复制文章内容自动添加博客名称和原文地址

网站管理后台—>主题设置—>自定义代码—>自定义底部HTML代码,把下面的 js 代码复制粘贴到里面即可。

<!--复制文章内容自动添加博客名称和原文地址 开始-->
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/layui/2.6.8/layui.min.js"></script>
<script type="text/javascript">
/**网站内容复制自动添加版权声明和原文地址*/
$(document).on("copy", function(e) {
  var selected = window.getSelection();
  var selectedText = selected.toString().replace(/\n/g, "<br>");
  var copyFooter =
      "<br>-----------------------<br>著作权归作者所有。<br>" +
      "商业转载请联系作者获得授权,非商业转载请注明出处。<br>" +
      "作者:默语空间<br> 源地址:" +
      document.location.href +
      "<br>来源:默语空间<br>© 版权声明:本文为博主原创文章,转载请务必保留原文链接!";
  if (document.location.pathname === "/") {
    var copyFooter =
        "<br>-----------------------<br>" +
        "来源:默语空间<br> 源地址:" +
        document.location.href +
        "<br>© 版权声明:商业转载请联系作者获得授权,非商业转载请注明出处。<br>";
  }
  var msgContent =
      '<span style="font-weight: 700;margin: 0 !important;">【默语空间(wp.moiyu.com)】<br>复制成功,若要转载请务必保留原文链接</span>' + copyFooter;
  layer.msg(msgContent, {
    time: 2000,
    shift: 2,
    shade: 0.3,
    skin: "wiiuii-layer-mode"
  });
  var copyHolder = $("<div>", {
    id: "temp",
    html: selectedText + copyFooter,
    style: {
      position: "absolute",
      left: "-99999px"
    }
  });
  $("body").append(copyHolder);
  selected.selectAllChildren(copyHolder[0]);
  window.setTimeout(function() {
    copyHolder.remove();
  }, 0);
});
</script>
<!--复制文章内容自动添加博客名称和原文地址 结束-->

1 2

© 版权声明
评论 抢沙发

请登录后发表评论

    暂无评论内容