好吧,可能不是最好的標題,但是meh。Facebook標記不起作用
我在我的WordPress主題的header.php上的<head>
標記裏面有以下代碼,用於檢查我是否啓用了Facebook。
<?php if ($config['social']['facebook']['enabled']): ?>
<script type="text/javascript">
<?php echo sprintf('window.fbAsyncInit = function() { FB.init(%s); }', json_encode($config['social']['facebook']['data'])); ?>
// Load the SDK Asynchronously
(function(d){
var js, id = 'facebook-jssdk'; if (d.getElementById(id)) {return;}
js = d.createElement('script'); js.id = id; js.async = true;
js.src = "//connect.facebook.net/en_US/all.js";
d.getElementsByTagName('head')[0].appendChild(js);
}(document));
</script>
<?php endif; ?>
此輸出以下瀏覽器:
<script type="text/javascript">
window.fbAsyncInit = function() { FB.init({"cookie":true,"fbml":true,"oauth":false,"status":true}); }
// Load the SDK Asynchronously
(function(d){
var js, id = 'facebook-jssdk'; if (d.getElementById(id)) {return;}
js = d.createElement('script'); js.id = id; js.async = true;
js.src = "//connect.facebook.net/en_US/all.js";
d.getElementsByTagName('head')[0].appendChild(js);
}(document));
</script>
注意到我有fbml
,但是,當我嘗試使用FBML,這是行不通的。我已經回顧了Facebook的開發人員文檔。我確實有xmlns
設置:
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="http://ogp.me/ns/fb#" xmlns:og="http://ogp.me/ns#">
我不知道爲什麼開發者文檔是一個爛攤子,但我無法找到任何沒有矛盾存在(當我找到開發商的幫助,而不是他們的功能解釋):/
在此先感謝!