按钮像增量号码,但不要在Facebook上发布,Facebook不识别元标签

时间:2012-10-06 02:13:26

标签: facebook button increment

我正在尝试在我的网站上实现“喜欢按钮”,并在Facebook上发布网站链接时显示预览功能,它显示标题,描述,图像等等。 我跟着Facebook开发者网站上的每一步,但它仍然无效!有谁可以帮助我吗?这是我的代码:

<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta http-equiv="Content-Language" content="pt-BR">    

    <meta property="og:title" content="Hostel Rosa dos Ventos"/>
    <meta property="og:type" content="hotel"/>
    <meta property="og:url" content="http://www.hostelrosadosventos.com.br"/>
    <meta property="og:image" content="http://www.hostelrosadosventos.com.br/Content/images/thumb_facebook.jpg"/>
    <meta property="og:site_name" content="RV Hostel"/>
    <meta property="fb:admins" content="100001714162833,1043531878"/>
    <meta property="og:description" content="Hostel localizado em Morro de São Paulo - BA"/>

    <title>Hostel Rosa dos Ventos</title>

    [...]
</head>

<div id="fb-root"></div>
<script>
    // Load the SDK Asynchronously
    (function (d) {
        var js, id = 'facebook-jssdk', ref = d.getElementsByTagName('script')[0];
        if (d.getElementById(id)) { return; }
        js = d.createElement('script'); js.id = id; js.async = true;
        js.src = "//connect.facebook.net/pt_BR/all.js#xfbml=1";
        ref.parentNode.insertBefore(js, ref);
    } (document));
</script>

我想要按钮的位置:

<fb:like href="http://www.hostelrosadosventos.com.br" width="450" height="80" show_faces="false"/>

怎么了?

当我尝试在

上调试它时

http://developers.facebook.com/tools/debug/og/object?q=http%3A%2F%2Fwww.hostelrosadosventos.com

它说我的meta标签不存在...... 我实际上吓坏了

1 个答案:

答案 0 :(得分:1)

可能是因为这些元标记未正确关闭

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="Content-Language" content="pt-BR">    

我知道这没关系,但你不知道FBs解析器是多么复杂。所以请尝试

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<meta http-equiv="Content-Language" content="pt-BR"/>