How To Embed Facebook Posts In Your Website
Facebook has presented an “embedded posts” feature to make you embed Facebook post – you can embed photographs, videos or any status updates – on another website or blog. For example, if a famous personality has shared a picture on his or her Facebook Page, you can simply insert that image on your website by adding one line of code.
You can insert any content that’s shared on Facebook Pages and own profiles as long as the content owner has set the discernibility of that post to Public. Now you can find this sample webpage that customs Embedded Posts from Facebook
However, there’s a small catch. Facebook has allowed the inserted Posts functionality for a one or two of immense web publishers like CNN, Mashable and The Huffington Post. Remaining will have to wait to see that Embed link along with their Facebook content.
Yet, There’s an easy workaround though that will let you insert any Facebook content on your website even if “Embedded Posts” are not legitimately available for that Facebook account.
Embed Code For Embedded Posts On Your Facebook Account
- <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/all.js#xfbml=1”;
- fjs.parentNode.insertBefore(js, fjs);
- }(document, ‘script’, ‘facebook-jssdk’));
- </script>
- <div class=“fb-post” data-href=“YOUR_URL_HERE”></div>
Go to any Facebook post and copy the permalink (permanent URL) of that post. To determine its permalink, right-click on date of the post. Then exchange your URL here with the permalink that now you copied in the snippet above and can paste the modified snippet wherever in your website.
If you like to embed another Facebook post on the same web page, you don’t have to copy-paste the whole snippet. For that add a new <fb:post> element and set the value of href as the permalink of your Facebook Post.
The workaround is no longer required for inserting Facebook posts in your website as Facebook has officially launched the code generator for inserted posts at developers.facebook.com.
Simply paste Facebook post URL, click Get Code key and pick the HTML5 version of the embed code. Still, warning on the Facebook says that, now embedded Posts are available to some of news publishers. but it can be ignored as the generated embed code works just good for any public post shared on Facebook.
This is all about embed Facebook posts to your website. Drop your comment on this to get appreciated.
You May Also Like: How To Download Facebook Albums Of Your Friends