ArtsAutosBooksBusinessEducationEntertainmentFamilyFashionFoodGamesGenderHealthHolidaysHomeHubPagesPersonal FinancePetsPoliticsReligionSportsTechnologyTravel
  • »
  • Technology»
  • Internet & the Web

Adding Facebook comments in Tumblr blog posts

Updated on March 27, 2013

The default Disqus commenting system implemented in Tumblr isn't my favorite. I like Facebook comments because it is light and easy. Disqus commenting system was off in my Tumblr blog I didn't even bother to turn it on and as always I came through some articles half of them worked for me but their setting up part worked not the implementing one. So here it is how I added Facebook comments in my Tumblr blog posts.

Adding Facebook Comments:

First of all you have to setup a Facebook app.

Setup Facebook App:

Even if you already have a Facebook account you have to sign up again at Facebook developers site to become a developer and then create an app. So head over to http://developers.facebook.com/apps and create your app, give it a name, there will also be a security check and then you can submit.

After submitting you'll be sent to the details page of you app. So in the Settings->Basic page of the app on the bottom click Website with Facebook login and enter your Tumblr blog url. You can enter an app namespace, I didn't enter any app namespace, enter your contact email and then the app domain which is also your Tumblr blog url or you can just span the domain and enter Tumblr.com. Just write down your app ID, you're gonna need it when implementing Facebook comments. Go to the Settings->Advanced page and make sure that App Type is selected as Web. You can also configure your app from that page there are many advanced settings on that page, I didn't touch any of that.

Implementing Facebook Comments:

First of all you need to add some meta codes to your theme. Add these meta codes right after the <head> attribute.

<meta property="fb:app_id" content="xxx"/>

Replace xxx with your Facebook app ID and add the below two lines right below the above one.

<meta property="og:title" content="{block:PostSummary}{PostSummary} - {/block:PostSummary}{Title}"/>
<meta property="og:description" content="{MetaDescription}"/>

Remove the "xxx" with your app ID from the below line.

<script src="http://connect.facebook.net/en_US/all.js#appId=xxx&amp;xfbml=1"></script>

And add the below codes right after {/block:Posts}

{block:PermalinkPage}
<fb:comments href="{Permalink}"></fb:comments>
{block:PermalinkPage}

If you add the above code before the {/block:Posts} then Facebook comments will also be shown on your homepage under every blog posts which will ruin your theme.

Getting Notifications of new comments

It is really easy just go to http://developers.facebook.com/tools/comments or simply click one of your posts and wait for the Facebook comments to load then click settings which is on the right of the comments. The settings tab will appear, you can find the Moderators field in the settings just add your Facebook name in the moderators field or any one of your friend's name who is willing to moderate your blogs comments. Save it and you're done. Note: If you add one of your friend's name then that person will receive a notification in which he has to accept if he wants to moderate your blog's comments.

That's it. Its really easy but many writers present their own instructions. The above method worked for me that's why I wrote about it. You can see a live demo at my blog post here.

    <meta property="fb:app_id" content="xxx"/>

Replace xxx with your Facebook app ID and add the below two lines right below the above one.

    <meta property="og:title" content="{block:PostSummary}{PostSummary} - {/block:PostSummary}{Title}"/>
    <meta property="og:description" content="{MetaDescription}"/>

Remove the "xxx" with your app ID from the below line.

    <script src="http://connect.facebook.net/en_US/all.js#appId=xxx&amp;xfbml=1"></script>

And add the below codes right after {/block:Posts}

    {block:PermalinkPage}
    <fb:comments href="{Permalink}"></fb:comments>
    {block:PermalinkPage}

Comments

    0 of 8192 characters used
    Post Comment

    • Ali Darakhshaan profile image
      Author

      Ali Ahmed 3 years ago from Karachi, Pakistan

      @Sofia 1- Can you be more specific please? and for no. 2 you have to create an app and add the app id in the meta tag mentioned above also turn on notifications for that app from the facebook developers area.

    • profile image

      Sofia 3 years ago

      HI!

      Thanks for the tutorial, it worked right off! I also wrapped a div around the code in order to be able to position it better in the theme.

      Problems:

      1. with or without the div, the comments box does not shop up in mozilla firexfox. (latest version) no idea why. Any thoughts?

      2. the comments do not get into the developers comments page. I can see them in the site, not in the facebook page.

      thanks!!!

    • Ali Darakhshaan profile image
      Author

      Ali Ahmed 3 years ago from Karachi, Pakistan

      And sorry for replying so late I've been extremely busy.

    • Ali Darakhshaan profile image
      Author

      Ali Ahmed 3 years ago from Karachi, Pakistan

      Line 10 goes right after the head tag. @Themibaby maybe you have remove quotes from the href or something please tell me how you are placing the codes in your theme. To adjust the width you can simply use style="width:110px;" put this code right after href="{Permalink}" remove the 110 with the width you want to specify.

    • profile image

      Thembibaby 3 years ago

      Im a begginer at all this and the thing is right where i want it buut it's a red box that says href url is not properly formatted. please help. and where does line 10 go, and by remove do u mean replace?

    • profile image

      Maria 3 years ago

      It worked but do u know how i can change the width?

    • profile image

      Bren 3 years ago

      Where does Line 10 go?

    • profile image

      Robin! 4 years ago

      This was really helpful! I just added Facebook comments to my own tumblr. I really like this option because people rarely comment on my site. They talk about it on Facebook. I figure this is a good way to get people to do it on my blog.