Facebook Like Meta 标签不显示图像
可能的重复:
Facebook Sharer 如何选择图像?
我已在所有内容上实现了 Facebook Like 按钮我们的页面,通过使用正确的元标签发布到 Facebook,它可以正常工作。不过,这些图片不会显示在 Facebook 上。当我使用 Facebook Linter 时,图像元标签会正确显示,但它们不会显示在某人的 Facebook 页面上,而在他们的墙上发布了“赞”。另外,有什么方法可以更频繁地重新缓存信息吗?标签需要永远更新。我们的网站是用 CakePHP 构建的。以下是我的代码片段,谢谢:
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:og="http://ogp.me/ns#"
xmlns:fb="http://www.facebook.com/2008/fbml">
<head>
<script src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script>
<script type="text/javascript" src="http://use.typekit.com/wlx8xgm.js"></script>
<script type="text/javascript">try{Typekit.load();}catch(e){}</script>
<?php
if(!isset($meta_title)) {
$meta_title = $title_for_layout;
}
if(!isset($meta_location)) {
$meta_location = null;
}
if(!isset($meta_image)) {
$meta_image = null;
}
if(!isset($meta_type)) {
$meta_type = null;
}
?>
<meta property="og:title" content="<?= $meta_title ?>"/>
<meta property="og:type" content="<?= $meta_type ?>"/>
<meta property="og:url" content="<?= $meta_location ?>"/>
<meta property="og:image" content="<?= $meta_image ?>"/>
<meta property="fb:admins" content="1004432800"/>
...
echo '<br><br><fb:like href="' . $fbook_url . '" width="300" height="80" layout="standard" show_faces="true" colorscheme="light"></fb:like>';
Possible Duplicate:
How does Facebook Sharer select Images?
I have implemented the Facebook Like button on all our pages and it works properly by posting to Facebook with the correct meta tags. However, the images do not show in Facebook. The image meta tags show up properly when I use the Facebook Linter, but they don't show on someone's facebook page where the Like is posted on their wall. Also, is there any way to have the info recache more often? The tags take forever to update. Our site is built with CakePHP. Below are snippets of my code, thanks:
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:og="http://ogp.me/ns#"
xmlns:fb="http://www.facebook.com/2008/fbml">
<head>
<script src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script>
<script type="text/javascript" src="http://use.typekit.com/wlx8xgm.js"></script>
<script type="text/javascript">try{Typekit.load();}catch(e){}</script>
<?php
if(!isset($meta_title)) {
$meta_title = $title_for_layout;
}
if(!isset($meta_location)) {
$meta_location = null;
}
if(!isset($meta_image)) {
$meta_image = null;
}
if(!isset($meta_type)) {
$meta_type = null;
}
?>
<meta property="og:title" content="<?= $meta_title ?>"/>
<meta property="og:type" content="<?= $meta_type ?>"/>
<meta property="og:url" content="<?= $meta_location ?>"/>
<meta property="og:image" content="<?= $meta_image ?>"/>
<meta property="fb:admins" content="1004432800"/>
...
echo '<br><br><fb:like href="' . $fbook_url . '" width="300" height="80" layout="standard" show_faces="true" colorscheme="light"></fb:like>';
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您使用什么类型的 URL?相对还是绝对?
另外,如果是缓存问题,则只需使用:
编辑:您应该使用类似插件中的
like
脚本what type of URL are you using? relative or absolute?
Also, if it's a cache problem then just use:
EDIT: You should use the
like
script from the like plugin page.