Forum Support

 
Advanced Search


New Posts
FAQs for Wordpress
If you have a question about Wordpress products please read through a list of our most commonly asked questions here.
[1]

Offline CloudTek
Free Member
Posts: 100
Posted on: March 14, 2018, 10:56:56 AM

Where's the best place to put the JS SDK code?

Code:
<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 = 'https://connect.facebook.net/en_US/sdk.js#xfbml=1&version=v2.12&appId=00000000000000&autoLogAppEvents=1';
  fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
Logged

Offline Tristan Rineer
Free Member
Posts: 3858
Posted on: March 15, 2018, 11:04:30 AM

There are a couple different options:

The option that I prefer is to use a custom HTML widget located in the "Debug" position.  Using the widget method in combination with Widget Context allows you to only include the code on pages that need it.

The other option is to put the code in one of the provided spaces on the "General" tab of the theme options.
Logged
[1]

Jump to:  


Powered by SMF | SMF © 2013, Simple Machines
Joomla Bridge by JoomlaHacks.com
Page created in 0.022 seconds with 21 queries.
Need some help getting your site up and running? Be sure to check out our tutorials area, post on the forum or hire us
Send Us An Email
Please send us your questions and we will email you back as soon as we can. Product support questions should be posted in our support forums under the Help menu. Our staff will assist you from there.