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.
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