Facebook connect is a Facebook API to integrate Facebook related social networking option to your website. It provides a secure layer of authentication mechanism to integrate partial Facebook features, user details for you. Today I’m going to show you a way to integrate Facebook authentication for your WordPress blog. This article assumes that you are already running WordPress 2.7 or above. It’s possible to make a Facebook connect plugin from the very scratch but here I’m covering the easy way to implement it. Alternatively because of some problems with this plugin, I’ve written another post for much more easier way to integrate facebook (Using Official Plugin). Now here are the steps to make you accomplish on this matter.
#1 – Make the Facebook Application
Do you have a Facebook Profile? If you don’t have a Facebook profile, create one first then move to Facebook developers page to create your website application. A Facebook application is required provide a secure layer of authentication and manage Facebook members for your website. Here is how you should do it.
- Visit Facebook Developers page
- Click on Start Now Button
- Once you are done you need to keep the settings page open for reference to the API Key.
#2 – Implementing the fbConnect Plugin
Sociable.es which is a part of SixJumps Social media marketing has created a wonderful OOP programmed Facebook Connect plugin which allows you to integrate Facebook connect in a minute inside your WordPress blog including Friend Invites, Last visited Facebook users Widget, Members of the blog and a profile page. This plugin also enables you to automatically create Facebook users on your blog database (Facebook uses don’t have to register to your blog) and able to syndicate the comments on the users Facebook mini-feed.
- Get the Facebook Connect plugin
- Extract, Upload and Install it on your WordPress plugins
- Open and Edit your themes header.php file and add this code inside. The Second line is important!
- Once you are done, save and update the header.php file
- Well you are almost done, just go to WordPress Admin > Appearance > Widgets to add the Facebook Connect Widget to your sidebar. Save your sidebar settings and you are done. Note that you can customize some of the options of the sidebar widget from by clicking on Edit options on the sidebar management admin panel.
- You can go to your blog now and have a look at the sidebar.
#3 â See it in Action
Now you’ve added the plugin to your system and integrated the functions to your blog. So it’s time for you to check it out. Try to login using your sidebar and you should be presented with a Facebook login popup dialog.
Once you enter the credentials, you should be logged in to your blog as a Facebook user and will be able to see your Facebook avatar at the sidebar panel.
These are only the basic setup of the plugin. If you like you can take it further, see the rest of this article get the idea of doing it.
#4 â Implement the Facebook Connect options in your Comment posting form (NOT necessary for the newer version of the plugin)
Now we are going to do some changes in the comments.php file which comes with your theme package. Here is a example of implementing the Facebook Login Button just before the Author Name field. Open your comments.php file in your favorite text editor. If you don’t have one you can read this and choose one for yourself and yes they are free. In your text editor search for the line wp-comments-post.php then follow the code changes below..