Home Forums Blogary WordPress Theme Facebook "share" button not working Reply To: Facebook "share" button not working

#6657

daviddietz
Participant

UPDATE:

I’ve added the following code to the Header.php in the WP editor, just below the <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/en_US/sdk.js#xfbml=1&appId=xxxxxxxxxxxxxxx&version=v2.0";
  fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>

Of course, the appId=xxxxxxxxxxxxxxx has to be a working app created in Facebook developer section (which mine is).

Now, all you have to do is add your code in blogary/template/single/content-social.php:

<div class="fb-like" data-href="<?php echo $permalink; ?>" data-layout="button_count" data-action="like" data-show-faces="true" data-share="false"></div>

  • This reply was modified 2 years, 10 months ago by  daviddietz.
  • This reply was modified 2 years, 10 months ago by  daviddietz.
  • This reply was modified 2 years, 10 months ago by  daviddietz.
  • This reply was modified 2 years, 10 months ago by  daviddietz.