Facebook Like Box in Text Widget?

Hi Aigars,

Ho can I add the facebook like box in a sidebar text widget?

  1. First of all you need to create a like box and you can do that by going to Facebook developers page.

  2. Now you will get a code like this(this is just an example and it uses Colorlib Facebook page in it):

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

<div class="fb-like-box" data-href="https://www.facebook.com/colorlib" data-height="300px" data-colorscheme="light" data-show-faces="true" data-header="false" data-stream="false" data-show-border="false"></div>
  1. Take above mentioned code (it consists of two parts but you need both of them) and add it inside Text widget inside WordPress that you can find under Appearance >> Widgets inside WordPress dashboard.

Let me know if this helps.

Thanks Aigars, it worked!