我的网站是http://tablified.com 我已经成功设置了Google Plus脚本。问题是,该网站的每个页面都显示不同的Google Plus计数。例如,如果你访问我的网站,你会看到我有大约180个Google Plus。现在,如果你点击“Tablified Apps”,你会看到屏幕左上角的Google Plus数字变为21。如何在整个网站上显示主页的Google Plus帐户,而不考虑显示的页面?我应该把脚本放在哪里?我正在Wordpress上运行此网站。也许一个插件可以解决这个问题,省去我的麻烦?问题是我需要把它放在那个确切的位置,我觉得一个插件无法做到这一点。谢谢你的帮助!
在我的网站的所有页面上显示一致的Google Plus图标
3 个回复
SO网友:Milo
你必须明确set the target url 或者,它将使用rel canonical(如果存在)或通过js获取当前页面的URL。
Use the button generator 然后单击“高级选项”设置目标URL,或者:
<g:plusone href="http://tablified.com/"></g:plusone>
SO网友:dwaser
如果您更改了目标URL,您需要知道,您的访问者只能在Google+1上搜索一次,这就是主页。如果用户喜欢你网站的另一个部分或页面,比如小报游戏,他们将无法用Google+1搜索该页面,因为他们已经这样做了,因为它总是相同的Google+1。
你有超过180个谷歌+1。180只用于主页,其他的则用于特定页面。
SO网友:Ajay Patel
Use this snippet
<!-- Place this tag in your head or just before your close body tag -->
<script type="text/javascript" src="https://apis.google.com/js/plusone.js"></script>
<!-- Place this tag where you want the +1 button to render -->
<g:plusone></g:plusone>
结束