Jump to content

Facebook: How do I embed a Facebook feed into a page?

Recommended Posts

Facebook supplies me with 2 code chunks. It says the first should be ideally after the opening body tag:


<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.4";
   fjs.parentNode.insertBefore(js, fjs);
 }(document, 'script', 'facebook-jssdk'));</script>

and the second should be wherever I want the plugin:


<div class="fb-page" data-href="https://www.facebook.com/la-pompe-jazz" data-tabs="timeline" data-width="500" data-height="700" 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/la-pompe-jazz"><a href="https://www.facebook.com/la-pompe-jazz">La Pompe Jazz</a></blockquote></div></div>

I put the latter chunk in a "code block" on my page.

This doesn't work no matter if I put the first chunk in the "code block" with the latter, nor if I embed that code in the header.

Does anyone know how to actually get this plugin to work?

Link to comment
  • Replies -1
  • Created
  • Last Reply

HiI followed your description above and it worked perfectly for me - which is great because it's something I wanted to be able to do!

Here's what I did. I pasted the first code chunk using the per-page code injection (click the gear icon beside the page name, the click Advanced)

alt text

Save this, then add a code block to the same page, and paste the second section of code like this:

alt text

Click Save to save the code block then Save again to save the page.

You may have to refresh the page or exit the edit mode (click arrow in top left corner of page) to make the Facebook data to appear.

Paul

Improve your online store with our extensions.
About: Squarespace Circle Leader since 2017. I value honesty, transparency, appreciation and great design ♥.
Work: Squarespace Developer and founder of SF Digital, building the features Squarespace didn't include™.
Content: Links in my posts may refer to SF Digital products or may be affiliate links.

Buy me a coffee

Link to comment

I doubt it is the template. Can you provide a link to the page?

Improve your online store with our extensions.
About: Squarespace Circle Leader since 2017. I value honesty, transparency, appreciation and great design ♥.
Work: Squarespace Developer and founder of SF Digital, building the features Squarespace didn't include™.
Content: Links in my posts may refer to SF Digital products or may be affiliate links.

Buy me a coffee

Link to comment
  • 2 months later...

Do this:https://developers.facebook.com/products/social-pluginsthere you will find anything you need. From like buttons to a complete Page feed. The developer page is buggy with adblockers installed so beware.Complete FB feed:https://developers.facebook.com/docs/plugins/page-plugin

Press: Get code. Paste first part of the code in advanced part of main page! Not the page where you want the feed to show.

Go to page where you want the page. Add an "embed" block. Not a code block!On the "embed" pop-up click the </> sign and paste the 2nd part of the code. "apply" and save the page and voila!

Link to comment
  • 5 months later...
  • 1 month later...

The Facebook widget creates an iframe which does not look good.

Due to lack of a good solution, I created a 100% free plugin called Famax that can be used embed all kinds of Facebook pages beautifully. Here is a small demo - http://demos.codehandling.com/famaxdemo3/famaxliveedit.html

Feel free to use this on your personal or any websites :)

Link to comment
  • 4 weeks later...
  • 3 months later...
  • 1 month later...
  • 5 months later...
  • 1 year later...

Archived

This topic is now archived and is closed to further replies.

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.