OK, to use Facebook Connect
1) install and activate the wp_facebookconnect plugin
2) create a Facebook application (the tutorial mentioned above explains the steps if you need help)
3) put the following code in your theme functions file (replacing your-API-key and
http://www.yoursite.com/ of course)
Code:
<?php
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 class="fb-comments">Comments:</p>
<script src="http://static.ak.connect.facebook.com/js/api_lib/v0.4/FeatureLoader.js.php" type="text/javascript"></script>
<fb:comments></fb:comments>
<script type="text/javascript"> FB.init("your-API-key", "http://www.jyoursite.com/xd_receiver.html"); </script>
<?php
}
}
function fb_comment_plug() {
if (!is_single() && !is_page()) {
?>
<p class="fb-comments"><a href="<?php echo get_permalink(); ?>#fb_comments">Add a comment</a></p>
<?
}
}
if ( is_admin() ) {
global $current_user;
get_currentuserinfo();
$user_info = get_userdata($current_user->ID);
if ( !is_null($user_info->fbuid) ) die( 'No access to WP-Admin for Facebook users!' );
}
?>
4) Add the following to your comments.php file
Code:
<?php if ( is_user_logged_in() ) { fbc_display_login_state(); } else { fbc_display_login_button(); } ?>
That's it!