Home » WordPress » 2 Simple Steps to Embed Facebook Post to WordPress

2 Simple Steps to Embed Facebook Post to WordPress

I was planning to show post thumbnails with large image on sidebar of my website. I searched for many plugins to do the same, but did not found any plugin which can show posts as I need. So finally I decided to show Facebook post to WordPress as featured post. The benefit of embedding Facebook post to WordPress is that, you can get easily likes and shares on your Facebook post and on click it will directly open the URL of your website or blog. Also the look and feel of the embed Facebook post is beautiful and responsive. So below I am giving an example in just 2 simple steps to embed Facebook post to WordPress blog.

1. First step is to get the Facebook post URL from your Facebook page by right clicking on the Post's publish date-time link and copy the link address as shown in below image.

embed facebook post to wordpress

2. Second step is to just add your post URL to below code (replace bold highlighted part with your post URL) and place this code anywhere of your website to show responsive Facebook post to WordPress blog.

<div class="fb-post" data-href="https://www.facebook.com/foxinfotech2014/posts/936059939867190/" data-width="auto"></div>

You can add above code to sidebar, below content or between content, footer anywhere of your WordPress blog.

Note: If your WordPress theme is not using Facebook SDK, then you need to load the SDK only once on a page, ideally right after the opening <body>tag. Below is the SDK code:

<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&amp;version=v2.5";
 fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>