如何让Facebook Open graph/social(如box)在我的网站上正常工作?

如何让Facebook Open graph/social(如box)在我的网站上正常工作?,facebook,facebook-graph-api,facebook-like,Facebook,Facebook Graph Api,Facebook Like,我想我已经用我的open graph/facebook应用程序设置正确设置了一切,但看起来仍然存在问题。我刚刚通过网络运行了我的网站,下面是我得到的信息。我不知道是什么导致了这些错误 /* ------------------------- Actions --------------------------- */ add_action('wp_head', 'wpse_43672_wp_head', 0); /** * Hooks into the `wp_head` action.

我想我已经用我的open graph/facebook应用程序设置正确设置了一切,但看起来仍然存在问题。我刚刚通过网络运行了我的网站,下面是我得到的信息。我不知道是什么导致了这些错误

/* ------------------------- Actions --------------------------- */

add_action('wp_head', 'wpse_43672_wp_head', 0);
/**
 * Hooks into the `wp_head` action.
 * @link http://codex.wordpress.org/Plugin_API/Action_Reference/wp_head
*/
function wpse_43672_wp_head(){ 
?> 

<script type='text/javascript'> 
(function(){ 
var bsa = document.createElement('script'); 
bsa.type = 'text/javascript'; 
bsa.async = true; 
bsa.src = '//cdn.beaconads.com/ac/beaconads.js'; 
(document.getElementsByTagName('head')[0]||document.getElementsByTagName('body')[0]).appendChild(bsa); 
})(); 

</script> 

<div id="fb-root"></div>

<script>
  window.fbAsyncInit = function() {
    FB.init({
      appId      : 'Y 11111111', // App ID
      channelUrl : '//WWW.url.com/channel.html', // Channel File
      status     : true, // check login status
      cookie     : true, // enable cookies to allow the server to access the session
      xfbml      : true  // parse XFBML
    });

    // Additional initialization code here
  };

  // 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/en_US/all.js";
     ref.parentNode.insertBefore(js, ref);
   }(document));
</script>

<?php 
            }
/*-------------------------------------操作-----------------*/
添加行动(“工作包头”,“工作包se\u 43672\u工作包头”,0);
/**
*钩住“wp_head”动作。
*@linkhttp://codex.wordpress.org/Plugin_API/Action_Reference/wp_head
*/
函数wpse_43672_wp_head(){
?> 
(函数(){
var bsa=document.createElement('script');
bsa.type='text/javascript';
bsa.async=true;
bsa.src='/cdn.beaconads.com/ac/beaconads.js';
(document.getElementsByTagName('head')[0]| | document.getElementsByTagName('body')[0]).appendChild(bsa);
})(); 
window.fbAsyninit=函数(){
FB.init({
appId:'Y 11111111',//应用程序ID
channelUrl:'//WWW.url.com/channel.html',//频道文件
状态:true,//检查登录状态
cookie:true,//启用cookie以允许服务器访问会话
xfbml:true//解析xfbml
});
//这里有额外的初始化代码
};
//异步加载SDK
(职能(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/en_US/all.js”;
ref.parentNode.insertBefore(js,ref);
}(文件);

你在HTML中有两个
标记。

你在HTML中有两个
标记。

哇..奇怪。我正在使用wordpress主题。你知道我要去哪里删除不应该在那里的/head吗?你可以通过
管理面板->外观->编辑器将其删除。在右边的文件中查找第一个
。我是建议从
Header.php
开始。谢谢。我删除了它。它处理了一些错误,但我仍然有一些错误。将
移到
之外的
中。我使用的是“插件”我会将代码粘贴到上面。有人为我创建了这个。它看起来不正确吗?哇..奇怪。我使用的是wordpress主题。你知道我会去哪里删除不应该在那里的/head吗?你可以通过
管理面板->外观->编辑器将其删除。查找中的第一个
右边的文件。我建议从
Header.php
开始。谢谢。我删除了它。它处理了一些错误,但我仍然有一些。将
移到
之外的
中。我使用的是“插件”我将把代码粘贴到上面。有人为我创建了这个。它看起来不正确吗?