如何指定图像用作 Facebook 共享的缩略图
我正在制作一个网站图库页面,并且在元标记中我设置了一个 og:image,因此当有人在页面上单击“喜欢”时,该图像将用作他们的 Facebook 墙上的故事缩略图。
当有人共享链接时,他们只能选择使用上面的图像作为故事的缩略图。有没有办法添加更多图像作为故事缩略图的选项,以便用户可以使用箭头并选择他们想要的图像?
如果我使用多个 og:image 标签,他们会有这个选项吗?如果是这样,如何选择点赞按钮的缩略图?
I am making a website gallery page, and in the meta tags I have set an og:image, so when someone clicks like on the page, the image is used as the story's thumbnail on their facebook wall.
When someone shares a link, they only have the option to use the image above as the story's thumbnail. Is there a way to add more images as options for the story's thumbnail so the user can use the arrows and select the image they want?
If I used more than one og:image tags, would they have that option? And if so, how would the like button's thumbnail image be selected?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
要在 Facebook 上获取多图像选择器,您需要从请求的页面中删除
og:image
并只包含一堆img
标记。Facebook 将抓取所有
img
标签并提供它们作为选择。要检测 facebook scraper,并显示特定于抓取的不同内容,只需检测下面的用户代理,并输出不同的内容(即仅您想要的 og 标签和一组 img 标签):
facebookexternalhit/1.1 ( +http://www.facebook.com/externalhit_uatext.php)
To get the multi image selector on Facebook, you would need to remove the
og:image
from the page being requested and just have a bunch ofimg
tags.Facebook will scrape all the
img
tags and offer them as choices.To detect the facebook scraper, and show different content specific for the scrape, just detect the user agent below, and output different content (i.e. only the og tags you want, and a set of img tags):
facebookexternalhit/1.1 (+http://www.facebook.com/externalhit_uatext.php)