embed post on website

How to embed facebook post on website?

Facebook embed post means, we can embed any public post on facebook to our website. There are lots of content on social media website like facebook, some content seems to be very useful and we want to plugin that content in our website. It become very easy by a facebook embed plugin.


If you embed a post in your website, you can see all related likes, shares and comments. You can like and share that post from website also. If someone deleted that post, a notice appear in place of post that, 'The page you requested is no longer available. The post may have expired or the privacy settings may have changed'.


How to use it:

There are two methods to use it on our website.

First method is simple to use.

If you have facebook access to that post, which you want to share.


Select a post which you want to embed in your website. In the right corner, there is an arrow mark. Click on it, you will get an options. Click Embed post link in the last. You will get a code generated. Paste that code any where you want to show that particular post.


Second method, if you have URL and want to embed the that URL content.

Follow below steps

  • You can embed post, if selected post is public.


    Paste the link in the browser address bar and check whether this link is pulic or not. Any one can identify public post by gray world icon, near publishing time.

  • Javascript-sdk is necessary to use for any facebook social plugin. So, this plugin is required to integrate embed post also. You can use following code just below tag in HTML file to use this sdk.
  • <!--HTML page default -->

    <body>

    <!--Javascript SDK -->

    <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.3";

    fjs.parentNode.insertBefore(js, fjs);

    }(document, 'script', 'facebook-jssdk'));</script>

  • After using javascript-sdk, put follwing code where you want to embed post in your website.

    <div class="fb-post" data-href="{public-post-url}"></div>

    Here 'public-post-url' will be the URL which you want to embed


    You can use following example for better understanding

    <?php $url="https://www.facebook.com/permalink.php?story_fbid=633855523313112&id=440524322646234"; ?> <div class="fb-post" data-href="<?php echo $url ?>"></div>

For more details, you can use following link. https://developers.facebook.com/docs/plugins/embedded-posts

Name
Email
Comments
Back
Funding

We need your support to operate it properly. We have lots of ideas but less fund, so help us with your funding.

Thoughts for the day

If a country is to be corruption free and become a nation of beautiful minds, I strongly feel there are three key societal members who can make a difference. They are the father, the mother and the teacher.

Dr. A.P.J. Abdul Kalam
Polls
Which device you use most for facebook application?
Laptop/PC
20%

 


Android
53%

 


IOS
13%

 


Blackberry
14%

 


Tutorial On Request
Q. Ask us for any tutorial or any thing which helps to build your career better.
Email:
Query: