Facebook分享网址缩略图问题 [英] Facebook share url thumbnail problem

查看:45
本文介绍了Facebook分享网址缩略图问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

<块引用>

可能的重复:
Facebook Sharer 如何选择图片?

希望在用户使用使用 http://的网站上的共享按钮共享网站 url 时共享缩略图www.facebook.com/sharer.php 来实现这一目标.

网站没有img标签,所有图片都定义在css中.

我为图片添加了元标记:

<前><meta property="og:image" content="/images/branding/branding-logo.png"/>

<前><link rel="image_src" href="/images/branding/branding-logo.png"/>

但它不起作用:(

解决方案

使用 Open Graph Meta 标签的完整列表:

  • og:title - 实体的标题.
  • og:type - 实体的类型.您必须从开放图谱类型列表中选择一种类型.
  • og:image - 表示实体的图像的 URL.图像必须至少为 50 x 50 像素.方形图片效果最好,但您最多可以使用宽度为高度三倍的图片.
  • og:url - 代表实体的页面的规范、永久 URL.当您使用开放图谱标签时,赞"按钮会发布一个指向 og:url 的链接,而不是赞"按钮代码中的 URL.
  • og:site_name - 您网站的可读名称,例如IMDb".
  • fb:admins 或 fb:app_id - 页面管理员的 Facebook ID 或 Facebook 平台应用程序 ID 的逗号分隔列表.至少,只包含您自己的 Facebook ID.

还要使用绝对 URL 而不是相对 URL!


请注意,Facebook 会在特定时期缓存网页,因此您可能不会立即注意到您的更改.检查 Facebook 是否/将真正接受您的更改的一个好方法是在您的 URL 中伪造一个参数.
例如,如果您的网址为:http://example.com/index.php
添加类似:http://example.com/index.php?123 然后在 URL Linter.;-)

编辑 2:
您可以直接使用 Facebook Linter(现在称为 Debugger),但请注意某些数据不能 在某些情况下会发生变化,如此处所述:

<块引用>

编辑元标签

您可以通过更新页面的属性来更新页面的属性标签.请注意 og:title 和 og:type 只能编辑最初 - 在您的页面收到 50 个赞后,标题就固定了,在您的页面收到 10,000 个赞后,类型就固定了.这些属性是固定的,以避免让喜欢的用户感到惊讶页面已经.在这些限制之后更改标题或类型标签到达什么都不做,您的页面保留原始标题并且类型.

Possible Duplicate:
How does Facebook Sharer select Images?

Want to have share thumbnail when user shares site url using share button on site which uses http://www.facebook.com/sharer.php to achieve that.

Site dose not have img tags, all images are defined in css.

I added meta tags for image:

<meta property="og:image" content="/images/branding/branding-logo.png"/>

and

<link rel="image_src" href="/images/branding/branding-logo.png"/>

but it's not working :(

解决方案

Use the full list of Open Graph Meta Tags:

  • og:title - The title of the entity.
  • og:type - The type of entity. You must select a type from the list of Open Graph types.
  • og:image - The URL to an image that represents the entity. Images must be at least 50 pixels by 50 pixels. Square images work best, but you are allowed to use images up to three times as wide as they are tall.
  • og:url - The canonical, permanent URL of the page representing the entity. When you use Open Graph tags, the Like button posts a link to the og:url instead of the URL in the Like button code.
  • og:site_name - A human-readable name for your site, e.g., "IMDb".
  • fb:admins or fb:app_id - A comma-separated list of either the Facebook IDs of page administrators or a Facebook Platform application ID. At a minimum, include only your own Facebook ID.

Also use absolute URLs instead of relative!

EDIT:
Please note that Facebook caches webpages for specific periods so you may not notice your changes right away. A good way to check if Facebook is/will actually take your changes is by faking a parameter in your URL.
for example if your URL reads: http://example.com/index.php
Add something like: http://example.com/index.php?123 and then use it in the URL Linter. ;-)

EDIT 2:
You could directly use the Facebook Linter (now called Debugger), but be aware that some data cannot be changed in some cases, described here:

Editing Meta Tags

You can update the attributes of your page by updating your page's tags. Note that og:title and og:type are only editable initially - after your page receives 50 likes the title becomes fixed, and after your page receives 10,000 likes the type becomes fixed. These properties are fixed to avoid surprising users who have liked the page already. Changing the title or type tags after these limits are reached does nothing, your page retains the original title and type.

这篇关于Facebook分享网址缩略图问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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