解决begin主题百度分享不支持https

  • A+
所属分类:WordPress

百度分享不支持HTTPS这件事由来已久,我之前向百度分享提交过这个问题,无果!近期使用begin主题分享按钮失效了(当然我用的破解版)主题用户咨询的比较多,我们就总结了解决方案。

第一步:下载百度分享必备文件

提取码: qghs

将压缩包上传到网站根目录后得到的static文件夹(注:域名/static)。

这个时候你就可以访问到js文件,比如我的博客

https://tshidai.top/static/api/js/share.js

第二步,登陆你的wordpress后台,外观,主题选项,SEO设置。将以下代码添加到流量统计代码(异步)

<?php if (zm_get_option('share')) { ?>
<script>window._bd_share_config={"common":{"bdSnsKey":{},"bdText":"","bdMini":"2","bdMiniList":false,"bdPic":"","bdStyle":"0","bdSize":"16"},"share":{},"image":{"viewList":["qzone","tsina","tqq","renren","weixin"],"viewText":"分享到:","viewSize":"16"},"selectShare":{"bdContainerClass":null,"bdSelectMiniList":["qzone","tsina","tqq","renren","weixin"]}};with(document)0[(getElementsByTagName('head')[0]||body).appendChild(createElement('script')).src='https://你的域名/static/api/js/share.js?v=89860593.js?cdnversion='+~(-new Date()/36e5)];</script>
<!-- 百度分享代码 -->
<?php } ?>

如下图:

至此,你就解决了百度分享不支持HTTPS的问题。

  • 我的微信
  • 这是我的微信扫一扫
  • weinxin
  • 我的微信公众号
  • 我的微信公众号扫一扫
  • weinxin
avatar

发表评论

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: