Add Facebook comments to my blog

Blogger does not support Facebook comments natively, but they can be installed by adding the required HTML to your blog.

To install a Facebook page plugin, it's best to use an HTML gadget, rather than customizing your template. This article provides a simple one-click button for installing the required HTML gadget on your blog.

Facebook comments rely on the Facebook JS SDK (JavaScript Software Development Kit).

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

Then, they need fb-comments markup.
Note that, in this gadget, this is done in custom HTML, since we need the canonical URL of the current page. In addition, we want to omit the title, and only want to render it on a single-item Post page.

<b:includable id='main'>
  <b:if cond='data:view.isPost'>
    <data:content />
    <div class='fb-comments'

Happy Facebooking!


Popular posts from this blog

Add syntax highlighting to my Blog

Change my post timestamps to a custom format

Add snippets to the Emporio theme