I have a post with 2 buttons, share and like:
<input class="fb-like contact-submit" data-href="<?php the_permalink(); ?>" type="button" value="LIKE">
<input class="fb-share-button contact-submit" data-href="<?php the_permalink(); ?>" type="button" value="SHARE">
function permalink in data-href print full url to this post(WordPress function).
I added javascript after opening body tag:
<div id="fb-root"></div>
<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/pl_PL/sdk.js#xfbml=1&version=v2.3";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
And it's not workig, nothing's happen 'on click'.
Why this code is not working? I read that to do this creating Facebook app is not needed. What's wrong?
Much thanks for everyone.