wordpress|在博客底部添加运行时间

linux admin 4个月前 (01-11) 129次浏览 0个评论

直接在主题的footer.php的适当位置插入如下代码:

<span id="runtime_span"></span> 
<script type="text/javascript">
function show_runtime()
{window.setTimeout("show_runtime()",1000);X=new 
Date("9/3/2021 0:00:00"); 
Y=new Date();T=(Y.getTime()-X.getTime());M=24*60*60*1000; 
a=T/M;A=Math.floor(a);b=(a-A)*24;B=Math.floor(b);c=(b-B)*60;C=Math.floor((b-B)*60);D=Math.floor((c-C)*60); runtime_span.innerHTML="网站已在风雨中飘摇了: "+A+"天"+B+"小时"+C+"分"+D+"秒"
}show_runtime(); 
</script>

 

 


VPS小白 , 版权所有丨如未注明 , 均为原创丨本网站采用BY-NC-SA协议进行授权
转载请注明原文链接:wordpress|在博客底部添加运行时间
喜欢 (0)
发表我的评论
取消评论
表情 贴图 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址