2012-09-26 87 views
0

我嘗試使用Facebook登錄我的Wordpress網站,所以我使用此代碼但啓用登錄。首先當我們填寫登錄憑證時,它再次返回到同一頁面。與Facebook登錄無法正常工作

<div id="fb-root"></div> 
    <script> 
    window.fbAsyncInit = function() { 
     FB.init({ 
     appId  : 'MY APP ID', // App ID 
     channelUrl : '//SITE URL', // Channel File 
     status  : true, // check login status 
     cookie  : true, // enable cookies to allow the server to access the session 
     xfbml  : true // parse XFBML 
     }); 
    }; 
    // 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> 

    <div class="fb-login-button">Login with Facebook</div> 

當我創建應用程序時,我只填寫我的電子郵件ID,站點URL和APP名稱。我的結局還剩下什麼嗎?

+0

它只是一個樣品或你的真正的代碼更加自由的插件?如果真的問題是你沒有提供appid和channelurl在上面的代碼 –

+0

它是我真正的代碼,我知道我寫的APP ID和CHANNEL URL。你能告訴我我的代碼有什麼問題? – Shobhit

回答

0

如果需要簡單的方法來Facebook登錄WordPress的,功能更加整合有像facebookall