Hawaiianz Posted April 30, 2015 Share 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? Link to comment Share on other sites More sharing options...
不中用 Posted April 30, 2015 Share 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 ? . Link to comment Share on other sites More sharing options...
Hawaiianz Posted April 30, 2015 Author Share Posted April 30, 2015 It worked. Thank you! Link to comment Share on other sites More sharing options...
irafa Posted July 10, 2015 Share 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. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.