[WordPress教程]底部显示安全运行时间

作者 : 墨惜 本文共1124个字,预计阅读时间需要3分钟 发布时间: 2020-03-21 共2.26K人阅读

看到别人站点发现底部有安全运行时间,是不是觉得很棒呢,下面来教大家如何操作吧。

如果是RiPro主题,请在diy-footer.php添加。其他主题在对应的footer 文件添加。

<h6> <span id=“momk”></span><span id=”momk” style=”color: #ff0000;”></span>
<script type=“text/javascript”>
function NewDate(str) {
str = str.split(‘-‘);
var date = new Date();
date.setUTCFullYear(str[0], str[1] – 1, str[2]);
date.setUTCHours(0, 0, 0, 0);
return date;
}
function momxc() {
var birthDay =NewDate(“2019-2-25”);
var today=new Date();
var timeold=today.getTime()–birthDay.getTime();
var sectimeold=timeold/1000
var secondsold=Math.floor(sectimeold);
var msPerDay=24*60*60*1000; var e_daysold=timeold/msPerDay;
var daysold=Math.floor(e_daysold);
var e_hrsold=(daysold–e_daysold)*–24;
var hrsold=Math.floor(e_hrsold);
var e_minsold=(hrsold–e_hrsold)*–60;
var minsold=Math.floor((hrsold–e_hrsold)*–60); var seconds=Math.floor((minsold–e_minsold)*–60).toString();
document.getElementById(“momk”).innerHTML = “本站勉强运行了”+daysold+“天”+hrsold+“小时”+minsold+“分”+seconds+“秒”;
setTimeout(momxc, 1000);
}momxc();
</script>  <style>
#momk{animation:change 10s infinite;font-weight:800; }
@keyframes change{0%{color:#5cb85c;}25%{color:#556bd8;}50%{color:#e40707;}75%{color:#66e616;}100% {color:#67bd31;}}
                 </style></h6>
本文归SVIP百宝箱版权所有©非注明网络来源文章请在转载时以链接形式注明作者和原始出处
SVIP百宝箱 » [WordPress教程]底部显示安全运行时间

常见问题FAQ

免费下载或者VIP会员专享资源能否直接商用?
本站所有资源版权均属于原作者所有,这里所提供资源均只能用于参考学习用,请勿直接商用。若由于商用引起版权纠纷,一切责任均由使用者承担。更多说明请参考 VIP介绍。

1 评论

  1. Some truly nice and useful information on this website, as well I think the design holds superb features. Katy Mattias Launce

  2. “Everything is very open with a clear explanation of the issues. It was truly informative. Your website is very helpful. Many thanks for sharing!”
    456854

    你的评论正在等待审核.

  3. “Hello! I just wish to give you a big thumbs up for your great information you have got here on this post. I will be coming back to your website for more soon.”
    68976543

    你的评论正在等待审核.

  4. “You ought to be a part of a contest for one of the finest blogs on the web. I most certainly will recommend this web site!”
    דירות דיסקרטיות בירושלים

    你的评论正在等待审核.

  5. “Next time I read a blog, Hopefully it does not fail me as much as this particular one. After all, I know it was my choice to read through, however I really thought you would probably have something interesting to say. All I hear is a bunch of moaning about something that you can fix if you were not too busy seeking attention.”

    你的评论正在等待审核.

发表评论

正在获取,请稍候...
00:00/00:00