向 Facebook 类似功能添加自定义图像
这可能看起来像一个重复的问题或者它是很容易回答这里,但我仍然完全困惑于这个功能是多么容易实现实施以及我在添加图像并找到有效的解决方案时遇到了多少麻烦。我一直在寻找没有结果。上面提供的两个链接显示了我找到的唯一两个选项,它们是:
<meta property="og:image" content="http://www.example.com/styles/images/fb_cl_logo.png"/>
不用
<link rel="canonical" href="http://www.example.com/Blogs_fb_build.php?id=<?php echo $blog; ?>"/>
说,这根本不起作用!
提前致谢。
This may seem like a duplicate question or it is easily answered here yet I remain utterly befuddled by how easy of a feature this is to implement and how much trouble I am having adding my image and finding a solution that works. I have been scouring to no avail. The two links provided above show the only two options I have found which are:
<meta property="og:image" content="http://www.example.com/styles/images/fb_cl_logo.png"/>
and
<link rel="canonical" href="http://www.example.com/Blogs_fb_build.php?id=<?php echo $blog; ?>"/>
Needless to say this is not working whatsoever!
Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
以下是两个可能的原因:
如果 Facebook 已缓存您页面的结果,请使用 Facebook 调试器 并输入页面的 URL,它通常会破坏缓存(如果行为不当,最好添加缓存破坏查询字符串)。
如果不是缓存问题,您将看到爬网程序看到有关您页面的哪些信息,这可能会解决您的问题。
另一件值得一提的事情是,破坏调试器中的缓存并不总是立即反映到“正常的 Facebook 发布”。
Here are two probable reasons:
If Facebook have cached the results your page, use the Facebook Debugger and enter the URL to your page, it will usually break the cache (can be good to add cache break querystring if it misbehaves).
If it isnt a cache problem you will see what information the crawler sees about your page which probably is going to solve your problem.
Another things worth mentioning is that breaking the cache in the debugger doesnt always reflect to the "normal Facebook posting" instantly.
因为您没有链接到图像,所以很难确定,但是您的图像是否在 Facebook 支持的 3:1 宽高比范围内?许多人不知道这个限制。如果图像太宽/太高,Facebook 的调试工具仍会检测到它,但不会在新闻提要中呈现
Because you didn't link to the image it's hard to be sure, but is your image within the 3:1 aspect ratio which Facebook supports? Many people aren't aware of that restriction. If the image is too wide/tall the Facebook's Debug Tool will still detect it but it won't be rendered in news feed