点赞按钮刚刚开始显示重复项。 Facebook 端有什么变化吗?

发布于 2024-12-03 15:08:25 字数 1695 浏览 0 评论 0原文

在过去几天的某个时候,我网站上的所有类似按钮现在都显示重复项,并且它们周围的间距发生了变化,因此空间太多了。最近 Facebook 端是否发生了一些变化,导致我以前工作正常的代码开始表现得像这样?

这是一个示例链接 http://www.weddingwise.co.nz/vendor/kumeu -山谷庄园。向下滚动到左侧文本下方一点,您会看到“赞”按钮。

我用来生成按钮的代码如下:

<div class="fb-like"><fb:like show_faces="false" font="lucida grande"></fb:like></div>

在我的身体底部,我有这段代码,

<div id="fb-root"></div>
<script>
window.fbAsyncInit = function() {
FB.init({appId: '150631368293357', status: true, cookie: true,
         xfbml: true});
};
(function() {
var e = document.createElement('script');
e.type = 'text/javascript';
e.src = document.location.protocol +
  '//connect.facebook.net/en_US/all.js';
e.async = true;
document.getElementById('fb-root').appendChild(e);
}());
</script>

我还在每个页面上打开了图形内容。与上面的链接匹配的示例是:

<meta property="og:title" content="Kumeu Valley Estate"/>
<meta property="og:type" content="article"/>
<meta property="og:url" content="http://www.weddingwise.co.nz/vendor/kumeu-valley-    estate/"/>
<meta property="og:image" content="http://www.weddingwise.co.nz/images/uploads/vendor-thumbs/kumeuestate.jpg"/>
<meta property="og:site_name" content="WeddingWise.co.nz"/>
<meta property="fb:app_id" content="150631368293357"/>
<meta property="og:description"content="Kumeu Valley Estate wedding vendor profile &amp; reviews on WeddingWise.co.nz"/>

此代码之前工作正常,但就在今天,我注意到类似按钮像这样重复。它们看起来功能良好,尽管这只是其中两个显示的美观问题。

这是一个错误还是 Facebook 做出了更改还是什么?我需要做什么才能让它们再次正常显示?

Sometime in the last few days all of the like buttons on my site are now showing duplicates and the spacing around them has changed so there is way too much space. Has something changed recently on facebook's end that would cause my code that used to work fine start behaving like this?

Here's an example link http://www.weddingwise.co.nz/vendor/kumeu-valley-estate. Scroll down a bit below the text on the left and you'll see the like button.

The code I'm using to produce the button is as follows:

<div class="fb-like"><fb:like show_faces="false" font="lucida grande"></fb:like></div>

And at the bottom of my body I have this code

<div id="fb-root"></div>
<script>
window.fbAsyncInit = function() {
FB.init({appId: '150631368293357', status: true, cookie: true,
         xfbml: true});
};
(function() {
var e = document.createElement('script');
e.type = 'text/javascript';
e.src = document.location.protocol +
  '//connect.facebook.net/en_US/all.js';
e.async = true;
document.getElementById('fb-root').appendChild(e);
}());
</script>

I also have open graph stuff on each page. Example of that matching the link above is:

<meta property="og:title" content="Kumeu Valley Estate"/>
<meta property="og:type" content="article"/>
<meta property="og:url" content="http://www.weddingwise.co.nz/vendor/kumeu-valley-    estate/"/>
<meta property="og:image" content="http://www.weddingwise.co.nz/images/uploads/vendor-thumbs/kumeuestate.jpg"/>
<meta property="og:site_name" content="WeddingWise.co.nz"/>
<meta property="fb:app_id" content="150631368293357"/>
<meta property="og:description"content="Kumeu Valley Estate wedding vendor profile & reviews on WeddingWise.co.nz"/>

This code was working fine before but just today I notice that the like buttons are duplicating like this. They appear to function fine though it's just the cosmetic problem of having two of them showing.

Is this a bug or has facebook made a change or what? What do I need to do to get them showing properly again?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

嘿看小鸭子会跑 2024-12-10 15:08:26

仅供参考,将 class="fb-like" 添加到 any 元素会导致此行为 - 就我而言。我错误地使用这个类名向 Facebook 和 Twitter 按钮容器添加填充,最终得到了 3 个类似 Facebook 的按钮!因此,请避免使用“fb-anything”作为类名。谁知道 Facebook 接下来会做什么?!

FYI adding class="fb-like" to any element causes this behaviour - in my case . I made the mistake of using this class name for adding padding to both Facebook and Twitter button containers and ended up with 3 Facebook like buttons! So avoid using "fb-anything" for class names. Who knows what Facebook will do next?!

转身泪倾城 2024-12-10 15:08:26

我不是 100% 确定,但我认为有一个未闭合的标签导致它渲染两次,因为当我查看源代码时,显然只有一个类似的按钮,而且我没有看到其他页面渲染两次。我首先修复列出的页面的大量 html 验证错误 此处 或检查您的源代码管理以确保其他内容没有发生改变导致这个问题。

I'm not 100% sure but I think there is an unclosed tag that is causing it to get rendered twice because when I look at the source code there is obviously only one like button and I haven't seen other pages rendering this twice. I would start by fixing alot of the html validation errors for the page listed here or check your source control to make sure something else didn't get changed that caused this problem.

倒数 2024-12-10 15:08:26

我有同样的问题。 Facebook 似乎在没有告诉任何人的情况下更新了他们的 fb:like 实施脚本。现在,它在任何找到类“fb-like”的地方添加了一个标准的 like 按钮!重命名该类可以解决该问题。

I had the same issue. Seems Facebook has updated their fb:like implementation script without telling anyone. It now adds a standard like button anywhere it finds class "fb-like"!! Renaming the class fixes the issue.

往日情怀 2024-12-10 15:08:25

我有同样的问题。

我不知道为什么,但将

中的类名更改为

已修复那。

I had the same issue.

I don't know why, but changing class name in <div class="fb-like"> to <div class="fblike"> fixed that.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文