当我的网站在Facebook上分享时,如何防止图像显示为缩略图选项? [英] How do I prevent an image from showing up as a thumbnail option when my site is shared on Facebook?

查看:98
本文介绍了当我的网站在Facebook上分享时,如何防止图像显示为缩略图选项?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当用户在Facebook上共享我的网站时,Facebook可以让他们选择一个缩略图来跟随分享。我想要的唯一图像是我的网站标识,但我不知道最好的方法是完成这个。

When a user shares my site on Facebook, Facebook allows them to select a thumbnail image to go along with the share. I'd like the only image made available to be my site logo, but I'm not sure what the best way to accomplish this is.

所以例如这个应该显示为一个选项:

So for example, this should show up as an option:

<img src="logo.png" />

但是我想要忽略其他图像:

But I'd like other images to be ignored:

<img src="news1.jpg" />
<img src="news2.jpg" />
<img src="footerDetail.jpg" />


推荐答案

嘿,这很简单,你只需要指定并在您的页面中打开图形元标记。

Hey, that's quite easy, you just need to specify and open graph metatag in your page.

对于您,将它简单添加到您的页面HEAD:

For you it would be as simple as adding this to your page HEAD :

<meta property="og:image" content="YOUR_IMAGE_URL"/>

您可以在这里找到开放图表元素的完整参考:http://developers.facebook.com/docs/opengraph/

You can find a complete reference of open graphs metatags here : http://developers.facebook.com/docs/opengraph/

您可以测试是否Facebook在这里找到您的图像:
http://developers.facebook.com/tools/lint

And you can test if facebook find your image correctly here : http://developers.facebook.com/tools/lint

(您需要使用第二个链接进行测试,以便Facebook将刷新其关于您网站的缓存信息。)

(You need to test it using the second link so that facebook will refresh its cached informations about your site).

干杯:)

这篇关于当我的网站在Facebook上分享时,如何防止图像显示为缩略图选项?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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