Alright, probably not the best title, but meh.
I have the following code inside my <head> tag on my WordPress theme’s header.php that checks whether I have Facebook enabled.
<?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; ?>
This outputs the following to the browser:
<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>
Noting that I have fbml, however, when I try to use FBML, it doesn’t work. I’ve reviewed Facebook’s Developer Docs about the issue. I do have the xmlns setup:
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="http://ogp.me/ns/fb#" xmlns:og="http://ogp.me/ns#">
I don’t know why the developer docs are a mess, but I can’t find anything that isn’t contradicted there (when I do find developer help, not explanations on their features) :/
Thanks in advance!
FBML is deprecated and you should use one of the newer technologies. See: https://developers.facebook.com/docs/reference/fbml/
You should recode your app to use the new JavaScript SDK (or other SDK of your choice that uses the Graph API.
Your init function is missing your AppId as well as channelUrl. You also wont be using oath parameter anymore since the SDK is not using only the oauth 2. I should look like:
See: https://developers.facebook.com/docs/reference/javascript/ for more information on how to work with the JS SDK.