Facebook的喜欢按钮:所有页面显示'0喜欢'或'{总数}喜欢'

问题描述:

我得到一些奇怪的结果与Facebook像按钮(反正我很奇怪)我有几个页面我的网站,但每个按钮上显示的喜欢数总是相同的 - 如果网页不是这样,并且网页已经显示网站本身喜欢的总数,则为0。Facebook的喜欢按钮:所有页面显示'0喜欢'或'{总数}喜欢'

在用户信息中心我让他们“喜欢”我的Facebook页面,这里是我使用的iframe:

<iframe src="//www.facebook.com/plugins/like.php? 
href=http://www.facebook.com/myfacebookpage&amp;send=false&amp; 
layout=button_count&amp;width=100&amp;show_faces=true&amp;action=like&amp; 
colorscheme=light&amp;font&amp;height=21&amp;appId={MY ID HERE}" 
scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:100px; 
height:20px;" allowtransparency="true"></iframe> 

然后在用户的个人资料页我让游客喜欢对方的个人资料页面。

对于页http://mywebsite.com/john

<iframe src="//www.facebook.com/plugins/like.php? 
href=http%3A%2F%2Fmywebsite.com%2Fjohn&amp;send=false&amp;layout=button_count 
&amp;width=100&amp;show_faces=true&amp;action=like&amp;colorscheme=light&amp; 
font&amp;height=21&amp;appId={MY ID HERE}" scrolling="no" frameborder="0" 
style="border:none; overflow:hidden; width:100px; height:20px;" 
allowtransparency="true"></iframe> 

对于页面http://mywebsite.com/billy

<iframe src="//www.facebook.com/plugins/like.php? 
href=http%3A%2F%2Fmywebsite.com%2Fbilly&amp;send=false&amp;layout=button_count&amp; 
width=100&amp;show_faces=true&amp;action=like&amp;colorscheme=light&amp;font&amp; 
height=21&amp;appId={MY ID HERE}" scrolling="no" frameborder="0" style="border:none; 
overflow:hidden; width:100px; height:20px;"` allowtransparency="true"></iframe> 

正如你可以看到我传递不同的href值每,所以据我可以看到(并阅读文档)我正确地做了这件事......一直在研究这个好几个小时,没有快乐。有人遇到类似的?

找到答案!

在打开的图元数据OG:URL始终设置为http://mysite.com

http://developers.facebook.com/docs/opengraphprotocol/

“喜欢的插件”并非真的用于Facebook页面。处理页面时,您会希望使用“像框插件”。它具有比插件更多的功能。检查出来:https://developers.facebook.com/docs/reference/plugins/like-box/