Hawaiianz Posted April 30, 2015 Posted April 30, 2015 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?
不中用 Posted April 30, 2015 Posted April 30, 2015 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 ? .
irafa Posted July 10, 2015 Posted July 10, 2015 Hello,I have put the code in templates/core/global/globalTemplate but it is not working; I can not see the answer of IN10TION.Some ideas?Regards,Rafa.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.