Embed Facebook Post into the Content of your Web Site / Web Page

Today I am going to tell how to embed public facebook post into the content of your website / webpage by using Facebook’s Javascript SDK

The Embedded Post will show any media attached to it, as well as the number of likes, shares, and comments that the post has. Embedding posts will let people using your web site see the same rich information that is shown on Facebook.com, and they will enable people to follow or like content authors or Pages directly from the embed.

Only public posts from Facebook Pages and profiles can be embedded.

Embed Facebook Post into the content of your web site

Step 1

Copy & paste below code into your webpage before </head> tag

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

Step 2

Copy & paste the below code into the content of your webpage.

<div id="fb-root"></div>
//embed facebook post by using facebook post permalink
<fb:post href="https://www.facebook.com/w3lessons.info/posts/487692307990112"></fb:post>

Please don’t forget to share and subscribe to latest updates of the blog. Comments and feedback’s are always welcome!

Thanks

View Live Demo

You May Also Like

Never Miss Any Web Tutorials, Guides, Tips and Free eBooks

Join Our Community Of 50,000+ Web Lovers and get a weekly newsletter in your inbox

 

I hate spam too. Unsubscribe at any time.

Leave a Comment