Html Facebook Share 不显示我的描述或我的缩略图

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/2950189/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-29 03:17:33  来源:igfitidea点击:

Facebook Share doesn't show my description or my thumbnail

htmlfacebook-sharer

提问by Drew

I have followed every single piece of advice I have found to try to get this to work but all of it has been to no avail. Can someone tell me why my description/thumbnail doesn't show up? Thanks. Below is my code and the link to the site:

我遵循了我发现的每一条建议,试图让它发挥作用,但所有这些都无济于事。有人能告诉我为什么我的描述/缩略图没有出现吗?谢谢。下面是我的代码和网站链接:

Meta Tags:

元标签:

<meta name="title" content="La Vita è Bella, because life is beautiful" />
<meta name="description" content="Drawing on Italy's most famous export – great-tasting, healthy, colourful food – La Vita é Bella brings families together to experience mealtimes the Italian way." />

<link rel="image_src" href="http://www.lavitaebella.co.uk/images/imageforfacebook.jpg" />

Actual Link:

实际链接:

<a href="http://www.facebook.com/share.php?u=http://www.lavitaebella.co.uk" target="_blank"><img src='../images/share/s-fb.png' /></a>

http://www.lavitaebella.co.uk/

http://www.lavitaebella.co.uk/

Thanks in advance for any help.

在此先感谢您的帮助。

采纳答案by zaphod

To those (like me) for whom the other answer did not work:

对于其他答案不起作用的人(如我):

In the <head>and </head>section, add

<head></head>部分,添加

<meta property="og:url" content="https://www.mathnuggets.com/" />
<meta property="og:image" content="https://www.mathnuggets.com/images/fb-logo.jpg" />
<meta property="og:title" content="Math website for your gifted student" />
<meta property="og:description" content="Challenging word problems for gifted elementary students" />` 

Then go to FB Linterand enter your URL there to refresh FB's cache of your page.

然后转到FB Linter并在那里输入您的 URL 以刷新页面的 FB 缓存。

^^^ Refreshing the cache is important.

^^^ 刷新缓存很重要。

回答by Drew

--2nd EDIT--

--第二次编辑--

Please note that this answer doesn't work any more and is out of date. Please try the above answer.

请注意,此答案不再有效并且已过时。请尝试上面的答案

-- ORIGINAL ANSWER--

-- 原答案--

Got it sorted. Had to use a url that is chock full of craziness:

整理好了 不得不使用一个充满疯狂的网址:

<a href="http://www.facebook.com/sharer.php?s= 100&amp;p[title]=La Vita è Bella&amp;p[url]=http://www.lavitaebella.co.uk/teachers/resources.html&amp;p[images][0]=http://www.lavitaebella.co.uk/images/imageforfacebook.gif&amp;p[summary]=Drawing on Italy's most famous export – great-tasting, healthy, colourful food – La Vita é Bella brings families together to experience mealtimes the Italian way"><img src='../images/share/s-fb.png' /></a>

--EDIT--

- 编辑 -

As some extra information, I can't remember where I originally found this information but here's what the s=100 part means:

作为一些额外的信息,我不记得我最初在哪里找到这些信息,但这是 s=100 部分的含义:

The basic approach is you are providing a link to http://www.facebook.com/sharer.php?s=100which is the basic share page (typically this is shown in a popup).

基本方法是您提供指向http://www.facebook.com/sharer.php?s=100的链接,这是基本共享页面(通常显示在弹出窗口中)。

But I tried changing the numbers and it still goes to the same place.

但是我尝试更改数字,它仍然到同一个地方。

As for the &amp;p, it's just html code for &p and I think this is the array that Facebook dissects to get at the information.

至于&amp;p,它只是 &p 的 html 代码,我认为这是 Facebook 剖析以获取信息的数组。