很早的时候就发现有些博客很漂亮,久而久之发觉其实都是源自同一个主题——Handsome
,于是乎自己也捣鼓着上线了自己的blog
.本文是基于Handsome
主题,在顶部导航处添加天气元素的教程。具体是哪位大佬提供的源代码已经忘了,在此表示感谢并记录!
将以下代码手动添加到/www/wwwroot/www.moekid.com/usr/themes/handsome/component
下的headnav.php
文件中,大约86
行左右的位置。
<!--天气开始-->
<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="utf8";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": "chameleon",
"container": "tp-weather-widget",
"bubble": "enabled",
"alarmType": "badge",
"color": "#ffffff",
"uid": "xxxxxxxx",
"hash": "xxxxxxxx"
});
tpwidget("show");</script>
<!--天气结束-->
6 comments
想想你的文章写的特别好www.jiwenlaw.com
不错不错,我喜欢看 https://www.ea55.com/
看的我热血沸腾啊https://www.237fa.com/
叼茂SEO.bfbikes.com
博主真是太厉害了!!!
博主真是太厉害了!!!