如何设置Facebook分享映像(仅作为后备)? [英] How to Set Facebook Share Image (Only as a Fallback)?

查看:263
本文介绍了如何设置Facebook分享映像(仅作为后备)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们当然可以使用以下设置默认共享映像:

We can of course use the following to set the default share image:

<meta property="og:image" content="http://website.com/images/icon.png" />

但是,有没有办法将其设置为仅备份,而不是默认值?意思是,只有使用Facebook才能从博客文章中找到更大,更合适的图片。

However, is there a way to set it as a fallback only, instead of a default? Meaning, only to be used IF Facebook can't find a larger, more appropriate image to use from the blog post.

注意 - Facebook已经自动清除了自己的任何来自网站所有者的帮助,尝试找到最合适的图像。只有,如果没有使用图像或太小的图像,如果使用用户定义的后备,而不是页面上找到的其他非相关的任意图像,那将是很好的。

Note - Facebook already scrapes on its own automatically without any help from the website owner to try and find the most appropriate image. Only, if there's not an image used or too small of one it would be nice if it used a user-defined fallback instead of some other non-related arbitrary image found on the page.

更好地了解Facebook分享抓取机器人的标准是否会有所帮助。或者如果可以简单地指定只从特定的div ID或类收集图像,如果没有发现使用回退,则可以。

A better understanding of what criteria is set for the Facebook share scraping bot would help a lot. Or if it were possible to simply specify to only collect an image from a specific div ID or class and that if none is found to use the fallback.

推荐答案

您可以在这里找到答案

You may find the answer in here How to show particular image as thumbnail while implementing share on Facebook?

Facebook将无法继续检查更大更合适的图像本身。你需要以某种方式指定它。即。您的wordpress特色图像或类似的东西

Facebook won't be able to go and check for a "larger more appropriate image" by itself. You'll need to specify it somehow. ie. Your wordpress Featured image or something like that

您可以做的是构建您的标题,以便您的后备是首先,然后如果可用,您可以覆盖它?

What you could do is structure your header so that you have the fallback one first, and then if available, you could override it?

<meta property="og:image" content="http://website.com/images/fallbackimage.png" />
 if bigger image specified
 <meta property="og:image" content="http://website.com/images/big-image-specified.png" />

有什么帮助吗?

这篇关于如何设置Facebook分享映像(仅作为后备)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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