WordPress网站添加新年倒计时

 时间:2026-02-14 09:29:07

1、进入WordPress网站后台

2、选择外观-小工具-添加自定义html小工具。

3、填写如下代码:

<div class="gn_box">

    <h1><center><font color=#E80017>2</font><font color=#D1002E>0</font><font color=#BA0045>2</font><font color=#A3005C>0</font><font

            color=#8C0073>年</font><font color=#75008A>-</font><font color=#5E00A1>新</font><font

            color=#4700B8>年</font><font color=#3000CF>倒</font><font color=#1900E6>计</font><font color=#0200FD>时</font>

    </center></h1>

    <center>

        <div id="CountMsg" class="HotDate">

            <span id="t_d">157 天</span>

            <span id="t_h">9 时</span>

            <span id="t_m">7 分</span>

            <span id="t_s">42 秒</span>

        </div>

    </center>

    <script type="text/javascript"> function getRTime() {

        var EndTime = new Date('2020/01/25 00:00:00');

        var NowTime = new Date();

        var t = EndTime.getTime() - NowTime.getTime();

        var d = Math.floor(t / 1000 / 60 / 60 / 24);

        var h = Math.floor(t / 1000 / 60 / 60 % 24);

        var m = Math.floor(t / 1000 / 60 % 60);

        var s = Math.floor(t / 1000 % 60);

        document.getElementById("t_d").innerHTML = d + " 天";

        document.getElementById("t_h").innerHTML = h + " 时";

        document.getElementById("t_m").innerHTML = m + " 分";

        document.getElementById("t_s").innerHTML = s + " 秒";

    }

    setInterval(getRTime, 1000);

    </script>

</div>

4、点击保存,即可前台浏览查看。

  • wordpress必装的插件 wp最常用的十个插件
  • 如何挑选钻石戒指 钻石戒指怎么选择
  • SONY RDR-VD60数字录像机说明书:[5]
  • 如何使用phpMyAdmin进行导出SQL设置
  • 一生必去的富士河口湖,详细交通指南
  • 热门搜索
    我的世界怎么调时间 怎么看银行卡余额 怎么学游泳 孩子发烧怎么物理降温 怎么画龙 pdf怎么转word u盘读不出来怎么办 树叶怎么画 新房契税怎么算 紫薯怎么做好吃