Facebook喜欢按钮:所有页面都显示'0 likes'或'{total number} likes'



我用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/

"like插件"并没有真正用于Facebook页面。在处理页面时,您需要使用"like-box插件"。它比同类插件有更多的功能。看看:https://developers.facebook.com/docs/reference/plugins/like-box/

相关内容

最新更新