• Home
  • Services
  • Facebook
  • Privacy Policy

TricksDaddy

  • Home
  • Services
  • Facebook
  • Privacy Policy

How To Add Facebook Like Button To WordPress Blog

Few days back Facebook introduced a new like button. Earlier like feature was available only on Facebook but now this new button extends this feature to other websites. This Facebook like button allow users to share your content back to their friends on Facebook.

Although Facebook has provided the documentation to add Facebook like button to your website but the documentation is easier only for single page websites. The difficulty comes when we add it to blog post. We need little customization and hack for this purpose.

Facebook Like Button

In this tutorial I’ll share how to add Facebook like button to WordPress blog.

How to add Facebook like button to WordPress ?

We have two methods to add Facebook like button to WordPress. One is by manually adding code into your theme file and other is by using plugin.

Method 1:

Open your single.php file in your theme folder and then copy and paste the following code wherever you want the code to appear:

<iframe src="http://www.facebook.com/plugins/like.php?href=<?php echo urlencode(get_permalink($post->ID)); ?>&layout=standard&show_faces=false&width=450&action=like&colorscheme=light" scrolling="no" frameborder="0"  allowTransparency="true" style="border:none; overflow:hidden; width:250px; height:40px">

Now save your file and you are done. You can adjust the following parameters in the code:

  • If you want to show the button only with button count then you can use the parameter layout=button_count instead of layout=standard.
  • If you want to show the faces of your friends then you can change show_faces=false to show_faces=true.
  • If you want to change the text from like to recommend then you can use the parameter action=recommend.
  • If you want to use the dark color scheme then you can use the parameter colorscheme=dark.

I hope this will help you to successfully add a like button to your WordPress. If you do not want to go into coding part then you can use the method 2.

Method 2:

This method is easy for all of use as it requires only to install a WordPress plugin. You can easily add like button using WordPress plugin but I’ll recommend you to use the method 1. Anyways here are few plugins listed below:

  • Facebook Like Button: This plugin allow you to add Facebook Like Button to your WordPress blog with a lot of customization options.
  • Like: It provides many features including adjust width height, layout options, color scheme, show thumbnail of Facebook profiles and more. It also supports multiple languages.
  • Facebook Like Button For WordPress: This plugin offers quick load time and also easy installation and customization features.

You can use any of the above listed methods. I’m using the first method here on my blog. Why not try this code by hitting like button at the top of this post 😀

You might also be interested in:

Add Google Buzz Button To WordPress Blog
How To Add Orkut Share Button To WordPress And Blogger Blogs ?
How To Add Floating Social Media Buttons To WordPress Blog Without Any Plugin

Are you going to add this button to your blog and which method you prefer out of the two methods listed here. Do let us know

Share On
 Previous Article Get a .Com Domain Name for Free of Cost
Next Article   100% Working Trick To Get Your Adsense Account Approval

6 Comments

  1. TechPapa-Jokes, Humor
    May 13, 2010 at 11:39 am

    Where i should paste the code in single.php file?
    .-= TechPapa-Jokes, Humor´s last blog ..Take Credit Automatically, When anyone copies Content From Your Blog =-.

    • Simrandeep
      May 13, 2010 at 1:20 pm

      Wherever you want the code to display.

      If you want to display it above the content then search for <div class="entry"> and paste the code above it.

  2. Shiva | Web Magazine
    May 13, 2010 at 3:56 pm

    I would probably use a plugin if I had to add a like button, otherwise I would screw up my codes 😉
    .-= Shiva | Web Magazine´s last blog ..5 Tips For Successful Blogging =-.

    • Simrandeep
      May 13, 2010 at 4:10 pm

      If you are not well in editing the codes you should chose wordpress plugin only. That’s why I provided two methods.

  3. Harsh Agrawal
    March 21, 2011 at 1:42 am

    Initially I loved the Fb share button but now since people are aware of usage of Fb like button and specially now it’s adopted the feature of Fb share button, it’s one of must have social bookmarking plugin that one should be installing.

    • Simrandeep Singh
      March 21, 2011 at 10:03 am

      @Harsh

      People might be aware of FB like button now but still FB share button is also effective. I think sharing posts over FB is better than liking them.

© Copyright. Theme by BloomPixel.