如何添加

  1. 打开handsome主题文件路径
  2. 打开component文件夹的headnav.php
  3. 将以下代码放入/usr/themes/handsome/component/headnav.php第55行!-- / search form --之后
<!-- 天气 --> 
<div id="tp-weather-widget" class="navbar-form navbar-form-sm navbar-left shift"></div> <script>(function(T,h,i,n,k,P,a,g,e){g=function(){P=h.createElement(i);a=h.getElementsByTagName(i)[0];P.src=k;P.charset="utf-8";P.async=1;a.parentNode.insertBefore(P,a)};T["ThinkPageWeatherWidgetObject"]=n;T[n]||(T[n]=function(){(T[n].q=T[n].q||[]).push(arguments)});T[n].l=+new Date();if(T.attachEvent){T.attachEvent("onload",g)}else{T.addEventListener("load",g,false)}}(window,document,"script","tpwidget","//widget.seniverse.com/widget/chameleon.js"))</script> <script>tpwidget("init", { "flavor": "slim", "location": "WX4FBXXFKE4F", "geolocation": "enabled", "language": "auto", "unit": "c", "theme": "black", "container": "tp-weather-widget", "bubble": "enabled", "alarmType": "badge", "color": "#00AFDB", "uid": "UB7BEE62D3", "hash": "3600ce1f732c2aa637f35517da5f7081" }); tpwidget("show");</script> 
<!-- 天气结束 -->
        
最后修改:2020 年 10 月 26 日
如果觉得我的文章对你有用,请随意赞赏