Facebook 分享不显示图像
我编写了一个新闻 PHP 脚本。每条新闻的末尾我都有一个 Facebook 分享按钮。问题是我无法通过 Facebook 共享显示缩略图。
我尝试了 Meta OG
<link rel="image_src" href="" />
element 但没有成功。有趣的是,一些使用我的新闻 PHP 脚本的域没有问题,但有些域却有问题。
域名没有任何问题:
有问题的域名:
- http://www.usakhabermerkezi.com/egitim-ogretim/usak-universitesi-rektorluk-secimleri-sonuclandi-iste-secim-sonuclari.htm
- http://www.demokrathaber.net/dunya/dunyanin-ekseni-kaydi.htm
- http://www.tebilisim.com /v4/siyaset/benzin-zamlardan-bizde-hosnut-degiliz.htm
我也尝试了 addThis
但它没有解决问题。
上述所有域名均使用同一系统。我认为这可能是因为系统的原因,所以我尝试了干净的 HTML 页面:
正如您在上一个示例中看到的,我使用了两种不同类型的共享选项。首先是弹出窗口。我通过 URL 发送了所有参数,但有些域显示图像,有些则不显示。我还添加了 addThis
选项。
我还考虑了 .htaccess 并清理了其中的所有内容,因为我认为 .htaccess 可能会阻止某些内容。我非常仔细地迈出了我能想到的每一步。
这个问题开始很烦人,如果有人能帮助我,我会很高兴。
I code a news PHP script. End of each news I have a Facebook share button. The problem is I can't display thumbnail images with Facebook share.
I tried Meta OG
<link rel="image_src" href="" />
element without any success. Interesting thing is, some of the domains which is using my news PHP Script, has no problem with it but some has.
Domain without any problems:
- http://www.yenialanya.com/manset/vergi-denetmenine-itiraz.htm (please check the bottom of the news)
Domains with problems:
- http://www.usakhabermerkezi.com/egitim-ogretim/usak-universitesi-rektorluk-secimleri-sonuclandi-iste-secim-sonuclari.htm
- http://www.demokrathaber.net/dunya/dunyanin-ekseni-kaydi.htm
- http://www.tebilisim.com/v4/siyaset/benzin-zamlardan-bizde-hosnut-degiliz.htm
I also tried addThis
and it didn't solve the problem.
All of the domain names above are using the same system. I thought it might be because of the system so I tried clean HTML page:
As you can see in the last example, I used 2 different kind of sharing options. First with popup. I sent all parameters over URL but some domains display images, some don't. I also added addThis
option.
I also thought about .htaccess
and cleaned everything in it since I thought .htaccess
might block something. I took every step very carefully which I could think of.
This issue started to be annoying, I would be glad if anyone could help me out.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
使用 Open Graph 协议
要测试每个链接,请使用 < a href="http://developers.facebook.com/tools/lint/" rel="noreferrer">URL Linter
看看这个论坛,大多数人都会问同样的问题,为什么是OG图片不适用于“喜欢”按钮。也许这是一个错误? 错误 16580
Use Open Graph protocol
To test each links use URL Linter
Look at this forum, most of them will ask same questions, why OG image is not working on like button. It's a bug maybe? Bug 16580
您使用的是公共服务器还是本地服务器?如果 URL 来自本地主机,Facebook 共享不会显示图片。
Are you using a public server or a local one? Facebook share doesn't show pictures if the URLs are coming from localhost.
Facebook 似乎想要双向至少 200 像素的图像,无论是在 OG 元数据中提供,还是只是嵌入在页面上。他们最近更新了 URL linter 以显示 OG 元数据的此错误。我现在找不到来源,但我认为以前它们的最大像素尺寸小于 200 像素...
此外,我还发现在 OS X 上的 Chrome 上显示缩略图时出现问题,在 Windows 浏览器上没有问题。真的很奇怪。
Facebook seems to want images that are at least 200px in both directions, whether supplied in the OG metadata, or just embedded on the page. They have updated their URL linter to show this error for the OG metadata recently. I can't find sources now, but I thought they used to have a maximum pixel dimension of less than 200px previously...
Also, I've seen problems displaying thumbnail images for Chrome on OS X, where on Windows browsers there is no problem. Really strange.
转到 http://developers.facebook.com/tools/debug 并填写您的网址
如果响应代码为503,则您的网站无法访问。可能您的网站正在建设中......
Go to http://developers.facebook.com/tools/debug and fill in your url
If the Responscode is 503 then your website is not accessible. It could be that your website is under construction…