当我在og:image
元标记中指定图片时,我不知道为什么facebook喜欢按钮会从网站主页上拉出随机图片。
这是html:
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="http://ogp.me/ns/fb#">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>Keeper Local</title>
<meta name="description" content="Keeper Local"/>
<meta name="keywords" content="Keeper Local"/>
<meta property="og:title" content="KeeperLocal"/>
<meta property="og:url" content="http://www.keeperlocal.com"/>
<meta property="og:image" content="http://keeperlocal.com/images/keeperlocallogo.jpg"/>
<meta property="og:description" content="Local shopping"/>
<meta property="og:site_name" content="KeeperLocal.com"/>
<meta property="og:type" content="website"/>
</head>
<body>
<img src="http://keeperlocal.com/images/keeperlocallogo.jpg">
<div id="fb-root"></div>
<script>(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) {return;}
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_US/all.js#xfbml=1";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
<div id="page-wrap">
<fb:like url="http://www.keeperlocal.com/test.html" send="false" layout="box_count" show_faces="false" width="50" height="40" action="like" colorscheme="light"></fb:like>
</div>
</body>
</html>
如果您想亲眼查看,此测试页面位于http://www.keeperlocal.com/test.html。为什么忽略og:image
元标记?
答案 0 :(得分:1)
您的图片太小。 Facebook要求og:图像一边至少200px。请参阅调试器:https://developers.facebook.com/tools/debug/og/object?q=http%3A%2F%2Fwww.keeperlocal.com%2Ftest.html