Facebook is a leading social media that bloggers like, to promote their blog posts. Adding the Facebook like box for your Facebook fan page in your WordPress blog makes you readers comfortable to share your content with his friends directly from the blog. Facebook has released numbers of social plugin and Open Graph protocol. Obviously, these things will take a leading part to make your site more sociable.
Related: Setup Facebook video call.
Well, there are two ways to integrate the Facebook social plugins into your site/blog.
Firstly, the easier one which allows you to directly place the code grabbed from your Facebook account to your blog template. But the second method demands some advanced knowledge. I would like to prefer XFBML as you can use all the plugins by using this protocol. Here we shall guide you to integrate Facebook social plugins into your site using XFBML protocol.
1. Register a Facebook application
There is nothing to worry as this will not ask you to learn a programming language. Just register the application by filling up a form.
Log-in to your Facebook account and go to the Facebook Application Creation page. Here, create your application providing the site name, site url and the locale.
Once your application is created successfully, you will be in your application dashboard. Keep a record of the application details e.g Application ID for future use.
2. Changing <html> tag
Now go to your theme folder and download the header.php file. Here replace the tag with the following code
xmlns="http://www.w3.org/1999/xhtml" xmlns:og="http://opengraphprotocol.org/schema/" xmlns:fb="http://www.facebook.com/2008/fbml" >
3. Further adding some code in hearder.php
Don’t leave out from your header.php file. Add the following code between <head> and </head> tags.
<meta property="fb:admins" content="Your User_ID"/> <meta property="og:title" content="<?php wp_title(' ',true,'right'); ?>"/> <meta property="og:site_name" content="Name of your site"/> <meta property="og:type" content="blog" />
<meta property=”og:image” content=”The url of your thumbnail“/>
Note: Don’t forget to replace the highlighted (red) and italic part with the right entry.
How can I get my Facebook User_Id?
Well, go to http://graph.facebook.com/your-facebook-username. You will find your user_id there.
You have just set up the interface to install social plugins using the XFBML protocol. upload header.php to its original place.
Now you have to chose the plugin that you want to use in your site. For this purpose go to Facebook social plugins page and find out your social plugin. You can choose any one from the list. Here we’ll guide you to install Like Box plugin for your Facebook fan page.
Click on Like Box from the plugin list. Now put the Facebook page url and the desired width of the widget. Select other options if you like.
Now click on “Get code”. You will get two types of code one is using iframe another is for XFBML protocol.
Copy the XFBML code and place it in your theme template where you want to show. Which method do you use- iFrame or XFBML protocol?