Jump to content

Where in theme should Facebook button javascript be located


Hawaiianz

Recommended Posts


To create Facebook's follow button they say you should add this Javascript to your page:

<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&version=v2.3";
  fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>

 

And then put this code where you want the button to appear:

<div class="fb-follow" data-href="https://www.facebook.com/MyFacebookPage" data-colorscheme="light" data-layout="button" data-show-faces="false"></div>

 

What's the best place to put the Javascript in an IPB Theme so it's available on every page?  Is there a specific section in the default Theme for custom Javascript?
 

Link to comment
Share on other sites


To create Facebook's follow button they say you should add this Javascript to your page:

<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&version=v2.3";
  fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>

 

And then put this code where you want the button to appear:

<div class="fb-follow" data-href="https://www.facebook.com/MyFacebookPage" data-colorscheme="light" data-layout="button" data-show-faces="false"></div>

 

What's the best place to put the Javascript in an IPB Theme so it's available on every page?  Is there a specific section in the default Theme for custom Javascript?
 

​.

 

This what you looking for ?

 

 

.

Link to comment
Share on other sites

  • 2 months later...

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...