2011-12-07 45 views
0

我想使用Facebook的開放圖來定製我的發送和喜歡的顯示,但它不工作,我不知道爲什麼。無法獲得Facebook像按鈕使用打開圖工作

這是我在的header.php頭:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:og="http://ogp.me/ns#" xmlns:fb="https://www.facebook.com/2008/fbml"> 

<!-- Head =================================================================================================--> 

<head> 
    <title>AskSanta - <?php echo $title; ?></title> 

    <meta http-equiv="content-type" content="text/html;charset=utf-8" /> 
    <meta name="author" content="" /> 
    <meta name="distribution" content="global" /> 
    <meta name="copyright" content="Copyright &copy; 2011 by JustAskSanta. All rights reserved." /> 
    <meta name="description" content="Content to be written here" />   
    <meta name="keywords" content="Keywords to be written here" /> 
    <meta property="og:title" content="Ask Santa Online" /> 
    <meta property="og:type" content="website" /> 
    <meta property="og:url" content="http://www.justanswersanta.com" /> 
    <meta property="og:image" content="http://www.justanswersanta.com/images/santa.png" /> 
    <meta property="og:site_name" content="Ask Santa Online" /> 
    <meta property="og:description" content="Hey kids (or kids at heart)! Want to ask Santa a question? Brought to you from the North Pole by JustAnswer."/> 

下面是thankyou.php類似按鈕;

<?php include("header.php"); ?> 

<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 class="fb-like" data-href="http://www.justanswersanta.com" data-send="true" data-layout="button_count" data-show-faces="false" data-font="lucida grande"></div> 

下面是輸出:

http://www.justanswersanta.com/thankyou.php

我在做什麼錯?

回答

0

您的代碼和OG標籤似乎是正確的。 我認爲您的網頁已被Facebook更早版本緩存。 Facebook有一個對象調試工具,通過這個工具你可以刷新緩存的頁面信息:http://developers.facebook.com/tools/debug

我已經探索了你的頁面this link。通過這種方式我刷新了您的頁面緩存。而現在,您的網站正在被正確報廢。請檢查一下。

+0

哦,它的工作!非常感謝! – salmanhijazi