Integrate Facebook Friend Connect With Wordpress Blog

by Shoaib Hussain on January 12, 2010

in Wordpress

Following the first post on how to Integrate Facebook friend connect to your WordPress thesis theme using the simple Facebook plugin ,in this post I will show how to  Manually add Facebook friend connect to your thesis theme.

Connect facebook and wordpress

Step-1

All you need to do go to Facebook developers sections and create a new application,name it what ever you want ,agree with the terms and conditions and click on create application.

Go to wordpress Developers section

Copy the API key from this window onto a notepad(will be needed later on)

Step-2

Copy  and paste the code given below in your text editor.(You can also get it from Facebook)

Save the file with the name-xd_receiver.html ( preferably somewhere in your desktop)

<!--DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> Cross-Domain Receiver Page

Save the file with the name-xd_receiver.html (somewhere in your desktop) and upload it to the custom folder of your thesis theme.

Step-3

Copy the api key from your facebook application window or notepad and paste this in the place  of [API_key] in the script given below

This goes in your custom_funtions.php file ,non thesis users need to put this in their functions.php file.

add_action('thesis_hook_after_post', 'fb_comment_box');
add_action('thesis_hook_after_post', 'fb_comment_plug');
add_filter('language_attributes', 'add_fb_xml_ns');

function add_fb_xml_ns($content) {
return ‘ xmlns:fb=”http://www.facebook.com/2008/fbml” ‘ . $content;
}

function fb_comment_box() {
if (is_single()) {
?>
<a name=”fb_comments”></a>
<p>Comments:</p>
// <!--[CDATA[-->
src="http://static.ak.connect.facebook.com/js/api_lib/v0.4/FeatureLoader.js.php" type="text/javascript">
// ]]>
<fb:comments></fb:comments>
// <!--[CDATA[-->
FB.init("[API_KEY]“, “http://www.yoursitename.com/wp-content/themes/thesis_16/custom/xd_receiver.html”);
// ]]>
<?php
}
}

function fb_comment_plug() {
if (!is_single() && !is_page()) {
?>
<p><a href=”<?php echo get_permalink(); ?>#fb_comments”>Add a comment</a></p>
<?
}
}

That done now go ahead and have a look at the options you have for you faceboook application that you just created.

Remember to go to the connect option and enter you callback url in their as shown in the picture below.

enter your url

Enter your blogs url in the place marked with arrow

Note:-Their will not a be and option for the commenter to enter the url of his/her blog while he/she is commenting.

Below are some screen shots of what this will look once implemented.

Facebook comment box

Facebook friend connect complete

This is how commentors profile will look like on your blog

Note:-Their will not a be and option for the commenter to enter the url of his/her blog while he/she is commenting.

Administration options

facebook freind connect comment moderation

You can moderate the comments from the front end of your blog

Found this hard read this post integrate Facebook friend connect with thesis theme use the simple Facebook connect plugin.

This is a guest post by Shoyeb who writes at what-what.net. If you like to write for Shoutmeloud, do read : Shoutmeloud revenue sharing program.

Related posts:

  1. Integrating Facebook Friend Connect with Thesis Wordpress Theme
  2. Facebook Fan page VS Google Friend Connect
  3. Automatically update your Wordpress blog copyright years
  4. Digg integrates with facebook using facebook connect
  5. Use Google Friend Connect to Send Newsletter To Members
  6. Fan Box : Facebook pages widget for your blog
  7. Google Friend Connect Added More features
  8. Thesis Open Hook Wordpress Plugin : Easily customize Thesis Wordpress Theme


{ 11 comments… read them below or add one }

1 Nandan January 12, 2010 at 11:52

very nice explaination

Reply

2 a_usman January 12, 2010 at 12:15

thanks for this one. very good tutorial indeed.

Reply

3 Mad Geek @beingPC January 12, 2010 at 12:26

Nice post Shoaib.
Btw, does this method works for all templates, I am kinda thinking of integrating this at my blog – http://www.beingpc.com

It has arthemia free theme in it can I use it, I don’t want to lose somrthing. :)

Reply

4 Furhead January 12, 2010 at 16:49

yeah you can use this method to integrate fb with any theme,just place the code in your functions.php and ur good to go.

Reply

5 Mad Geek @beingPC January 13, 2010 at 09:23

Thanks buddy, will try it soon.

Reply

6 Uttoran Sen January 12, 2010 at 13:18

excellent guest post, shoaib, quite a detailed explanation, am a non thesis user so will just need to find out the functions file,

Reply

7 Dinesh January 12, 2010 at 20:19

Wow man, this is great stuff. I saw this only in Disqus and that sort of commenting platforms, and also on Tech Crunch.

Reply

8 Rajesh Kanuri @ TechCats January 12, 2010 at 23:31

Very nice post.. This is what I am looking for from a long time.. Thanks for the coding.. :)

Reply

9 d3monoid January 13, 2010 at 01:06

this thing really worth can help to the people to setup it wid easy way! :)

Reply

10 Shayon Pal January 23, 2010 at 17:11

Aint really working for me…trying to debug!

Reply

11 Mary January 24, 2010 at 09:00

hi,

please were do i upload the xd_receiver.html file to, i have a woo theme with no custom folder and i tried inserting the script into the functions.php but it came up with an error page. would appreciate if you could tell me were to paste this script. woo theme has the following php files.
404 Template (404.php)
Archives (archive.php)
Comments (comments.php)
Footer (footer.php)
Header (header.php)
Main Index Template (index.php)
Page Template (page.php)
Search Results (search.php)
Sidebar (sidebar.php)
Single Post (single.php)
Theme Functions (functions.php)
Video Attachment Template (video.php)
admin-custom.php (admin-custom.php)
admin-functions.php (admin-functions.php)
admin-interface.php (admin-interface.php)
admin-setup.php (admin-setup.php)
admin-theme-page.php (admin-theme-page.php)
ads-300×250.php (ads-300×250.php)
ads-bottom.php (ads-bottom.php)
ads-management.php (ads-management.php)
ads-top.php (ads-top.php)
archives.php (archives.php)
block_ads.php (block_ads.php)
blog.php (blog.php)
comments-legacy.php (comments-legacy.php)
custom.php (custom.php)
default.php (default.php)
easytube.php (easytube.php)
featured.php (featured.php)
home.php (home.php)
imagegallery.php (imagegallery.php)
mpu_ad.php (mpu_ad.php)
pagenavi.php (pagenavi.php)
popular.php (popular.php)
sidebar-init.php (sidebar-init.php)
sitemap.php (sitemap.php)
stylesheet.php (stylesheet.php)
tag.php (tag.php)
template-imagegallery.php (template-imagegallery.php)
test.php (test.php)
theme-comments.php (theme-comments.php)
theme-functions.php (theme-functions.php)
theme-js.php (theme-js.php)
theme-options.php (theme-options.php)
theme-widgets.php (theme-widgets.php)
thumb.php (thumb.php)
top_ad.php (top_ad.php)
version.php (version.php)
Styles
Stylesheet (style.css)
slideshow.css (slideshow.css)

Please help, i am a novice

Reply

Leave a Comment

Previous post:

Next post: