Facebook Like button - fetches “wrong” image [duplicate]

徘徊边缘 提交于 2019-12-06 05:56:15

问题


Possible Duplicate:
How does Facebook Sharer select Images?

I'm using the following code to add a Facebook like button to my site:

<iframe src="http://www.facebook.com/plugins/like.php?href=XXXXXXXX&amp;send=false&amp;layout=button_count&amp;width=50&amp;show_faces=false&amp;action=like&amp;colorscheme=light&amp;font&amp;height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:50px; height:21px;" allowTransparency="true"></iframe>

When I later look at my wall I can see the post that I've just liked. But it shows a gui-widget (from the sites grafik) not any other "valid" images. Is it possible to specify which image to show?


回答1:


You'll want to use open graph tags (namely <og:image>) to specify what image you want to show.

Additionally, you can use the URL Linter to debug what you're sending Facebook. You may have some issues with the linter as it says it decaches when you lint a URL, but in practice it doesn't always work that way.




回答2:


You can provide metadata at the page you're liking that will populate the image.

Check this out: Want custom title / image / description in facebook share link from a flash app

In the example provided the page returns metadata that allows Facebook to set the description, caption, and image for the object (your page) being liked.



来源:https://stackoverflow.com/questions/5888638/facebook-like-button-fetches-wrong-image

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!