Can't get the facebook like button to work using open graph
-
29-10-2019 - |
题
I'm trying to use Facebook open graph to customize my send and like display, but it's not working and I have no idea why.
Here's my header in 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 © 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."/>
Here's the like button in 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>
Here's the output:
http://www.justanswersanta.com/thankyou.php
What am I doing wrong?
没有正确的解决方案
不隶属于 StackOverflow