【问题标题】:Facebook like button: All pages show either '0 likes' or '{total number} likes'Facebook 赞按钮:所有页面显示“0 个赞”或“{total number} 个赞”
【发布时间】:2012-03-02 22:31:44
【问题描述】:

我在 Facebook 的点赞按钮上得到了一些奇怪的结果(对我来说还是很奇怪) 我在我的网站的几个页面上都有点赞按钮,但每个按钮上显示的点赞数始终相同 - 如果页面不喜欢,如果页面喜欢,则显示网站本身的喜欢总数。

在用户仪表板上,我允许他们“喜欢”我的 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 值,所以据我所知(并在文档中阅读)我做得正确......一直在研究这个几个小时,没有任何乐趣。有人遇到过类似的吗?

【问题讨论】:

    标签: html facebook facebook-like


    【解决方案1】:

    找到答案了!

    在打开的图元数据中,og:url 始终设置为http://mysite.com

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

    【讨论】:

      【解决方案2】:

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

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2012-12-17
        • 2012-10-14
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2011-10-27
        • 1970-01-01
        相关资源
        最近更新 更多