• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

XF 1.2 Where to Place Facebook Code?

billybatz9

Active member
#1
I would like to add a facebook feed to my sidebar. I am using...
https://developers.facebook.com/docs/plugins/page-plugin

to do it.

However, I am not sure where to place the code that says to:
1. Include the JavaScript SDK on your page once, ideally right after the opening <body> tag.
Can someone help please.

This is the 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 = "//connect.facebook.net/en_US/sdk.js#xfbml=1&version=v2.5&appId=581373728571580";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
 

billybatz9

Active member
#3
If you want it in the sidebar, you can add it to one of the ad_sidebar_* templates.
Wouldnt this code go there?
<div class="fb-page" data-href="https://www.facebook.com/facebook" data-tabs="timeline" data-small-header="false" data-adapt-container-width="true" data-hide-cover="false" data-show-facepile="true"><div class="fb-xfbml-parse-ignore"><blockquote cite="https://www.facebook.com/facebook"><a href="https://www.facebook.com/facebook">Facebook</a></blockquote></div></div>