wordpress添加ClustrMaps

首先到http://www.clustrmaps.com/zh/index.htm生成自己的地图

然后注册登录账号,获取地图代码


根据主题布局放置代码位置,这里我放在右侧。

编辑文件sidebar-right.php,添加以下内容:


<!–ClusterMap–>
<aside class=”widget”><h3 class=”widget-title”>统计</h3><div id=”clustrmaps-widget”></div><script type=”text/javascript”>var _clustrmaps = {‘url’ : ‘http://blog.cenhq.com', ‘user’ : 1181037, ‘server’ : ‘3’, ‘id’ : ‘clustrmaps-widget’, ‘version’ : 1, ‘date’ : ‘2015-10-16’, ‘lang’ : ‘zh’, ‘corners’ : ‘square’ };(function (){ var s = document.createElement(‘script’); s.type = ‘text/javascript’; s.async = true; s.src = ‘http://www3.clustrmaps.com/counter/map.js'; var x = document.getElementsByTagName(‘script’)[0]; x.parentNode.insertBefore(s, x);})();</script><noscript><a href=”http://www3.clustrmaps.com/user/f5e12056d"><img src=”http://www3.clustrmaps.com/stats/maps-no_clusters/blog.cenhq.com-thumb.jpg" alt=”Locations of visitors to this page” /></a></noscript></div></aside>

效果显示:


坚持原创技术分享,您的支持将鼓励我继续创作!