Facebook Share对话框图像不显示 [英] Facebook Share Dialog image doesn't show

查看:181
本文介绍了Facebook Share对话框图像不显示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Facebook共享对话框( https://开发人员。 facebook.com/docs/reference/plugins/share-links/ ),图像不会显示。我在其他论坛检查了很多帖子,但找不到解决方案

I'm using the Facebook Share Dialog (https://developers.facebook.com/docs/reference/plugins/share-links/) and the image doesn't appear. I've checked a lot of posts here in SO an other forums but couldn't find a solution

我发现这个网站共享对话框工作正常: http://election.gv.my/ (他们不使用meta property =og:image)

I found this site where Share Dialog works correctly: http://election.gv.my/ (They don't use meta property="og:image")

https://www.facebook.com/sharer /sharer.php?s=100&p[url]=http%3A%2F%2Felection.gv.my%2F&p[images][0]=http%3A%2F%2Felection.gv.my%2Fassets% 2Fcombined.jpg&安培; p [标题] =马来西亚+微博+人气+索引&安培; p [摘要] =马来西亚+微博+人气+指数+为+三月+ 31%2C + 2013%3A +%40anwaribrahim + 21%2C +%40NajibRazak + 28

如果我在我的代码中使用它的图像,它显示:


var sharer =https://www.facebook.com/sharer/sharer。 php?s = 100& p [url] =+ shareURL +& p [images] [0] =+http://election.gv.my/assets/combined.jpg+& p [title] =+ shareTitle +& p [summary] =+ shareExcerpt;

If I use its image in my code, it shows:
var sharer = "https://www.facebook.com/sharer/sharer.php?s=100&p[url]=" + shareURL + "&p[images][0]=" + "http://election.gv.my/assets/combined.jpg" + "&p[title]=" + shareTitle + "&p[summary]=" + shareExcerpt;

如果我在其代码中使用我的图片,它不会:

https:// www.facebook.com/sharer/sharer.php?s=100&p[url]=http://election.gv.my/&p[images][0]=http://mysite.com/app /wp-content/uploads/2013/03/poster.jpg&p[title]=Malaysia+Twitter+Popularity+Index&p[summary]=Malaysia+Twitter+Popularity+Index+for+March+31%2C+2013 %3A +%40anwaribrahim + 21%2C +%40NajibRazak + 28

If I use my image in its code it doesn't:
https://www.facebook.com/sharer/sharer.php?s=100&p[url]=http://election.gv.my/&p[images][0]=http://mysite.com/app/wp-content/uploads/2013/03/poster.jpg&p[title]=Malaysia+Twitter+Popularity+Index&p[summary]=Malaysia+Twitter+Popularity+Index+for+March+31%2C+2013%3A+%40anwaribrahim+21%2C+%40NajibRazak+28

我可以想到的唯一原因是服务器配置中的一些。我已经在 https://developers.facebook.com/tools/中检查过我的网址(网站和图片)调试,结果确定,至少与该站点相同

The only reason I can think of is something in the server configuration. I've checked my url (website & image) in https://developers.facebook.com/tools/debug and the results are OK, at least the same as that site

推荐答案

我的情况下的问题是图像由WordPress生成的大小:

The problem in my case was image sizes generated by WordPress:


  • NO:85x85,96x54,166x94,170x96,193x108,711x400

  • 是:356x200,360x124

https://developers.facebook.com/docs/opengraph/howtos/maximizing-distribution-media-content/

og:image - 这是与您的媒体相关联的图像。我们建议您使用至少200x200像素的图像。然而,更大的更好,所以如果你有一个可以使用的1500x1500图像,请使用它。我们会对使用较小分辨率设备的人员进行缩小比例并裁剪,但会在较大的设备上使用。该图像越大,在Facebook上分享故事时就越有可能使用此图像。 (注意:图像尺寸不得超过5MB)。

https://developers.facebook.com/docs/opengraph/howtos/maximizing-distribution-media-content/
og:image – This is an image associated with your media. We suggest that you use an image of at least 200x200 pixels. However, bigger is better, so if you have a 1500x1500 image that you can use, please use it. We'll downsample and crop it for for people using smaller-resolution devices but will use it on a larger device. The larger this image is, the more likely it will be used when sharing stories on Facebook. (Note: image sizes must be no more than 5MB in size.)

但这并不能解释为什么大小356x200可以,但是没有711x400更大,相同的宽高比

But this doesn't explain why size 356x200 is ok but no 711x400 wich is bigger and has the same aspect ratio

这篇关于Facebook Share对话框图像不显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆