Add image to facebook share

不打扰是莪最后的温柔 提交于 2019-12-10 06:18:43

问题


I'm trying to add an image to page share via https://developers.facebook.com/docs/plugins/share-button/ However, I can't seem to find how can I add an image to the facebook share post


回答1:


As rightly commented by demrks, Facebook uses open graph meta tags.

For your specific problem, you can use the og:image meta tag,

<meta name='og:image' content='path'>

Replace path with the path to where your image is.

You can check how your url appears on the timeline by using the Facebook url debugger.




回答2:


The Nov 18, 2013 answer is deprecated. The current answer according to https://developers.facebook.com/docs/sharing/webmasters/

<meta property="og:image" content="http://static01.nyt.com/bookJumbo-v2.jpg" />


来源:https://stackoverflow.com/questions/20046955/add-image-to-facebook-share

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