maexculture.tumblr.com is my site.
Just installed the facebook button and first of all, it asks to confirm the likes, then after confirming and pressing "Like" it switches to count it and then goes back to zero. The "send" function works. But the Like function is not - nothing shows up on facebook and the like is not counted.
This is what I have at the top of my page:
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:fb="https://www.facebook.com/2008/fbml"
xmlns:og="http://ogp.me/ns#"
xml:lang="en"
lang="en">
And the specific buttons:
<div class="facebook-button">
<div class="fb-like" data-href="{Permalink}" data-send="true"
data-layout="button_count" data-width="450"
data-show-faces="true"></div>
</div>
I also have this code in there near the head tags
<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&appId=271140516272162";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
Let me know if you need any more information.
Couple issues:
If your code is "near the head tags" there's a good possibility that the DOM won't have been fully populated when it executes, and therefore that it will miss detecting some elements. Any script that accesses or manipulates existing DOM elements needs to come after any HTML that creates those elements (e.g. right before </body>
).
fjs = d.getElementsByTagName(s)[0]
is really fragile, since it depends on one particular script element being the very first one in your document. Put an ID on that script and then look it up with getElementByID()
To answer your comment, I mean something like (in HTML)
<script id="fjs" type="text/javascript" src="..." </script>
(in processing script)
fjs=d.getElementByID('fjs');
In other words, instead of counting on a particular <script>
element being the first one in your document, you stick an id
label on it so you can find it no matter where it is.