Shape 5

Wordpress Free Themes => Forte - Free => : CloudTek March 14, 2018, 10:56:56 AM



: WP / Vertex Themes & FB integration
: CloudTek March 14, 2018, 10:56:56 AM
Where's the best place to put the JS SDK 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>


: Re: WP / Vertex Themes & FB integration
: Tristan Rineer 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 (https://wordpress.org/plugins/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.