How to Add Facebook Comments to WordPress

Applies to Version(s): Thesis 1

Comments Box is a Facebook social plugin that enables user Facebook comments on your WordPress installation.

Here’s how to add this plugin to your Thesis site.

First, place the following code in custom_functions.php:

function fb_comments() {
	if (is_single()) { ?>
		<div class="fb_comments">
		<div id="fb-root"></div><script src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script><fb:comments href="<?php the_permalink(); ?>" numposts="5" width="500" publish_feed="true"></fb:comments>
		</div>
	<?php }
}

add_action('thesis_hook_after_post_box', 'fb_comments');

Then, place the following code in custom.css (modifying as desired to match your own site design):

.fb_comments { margin:20px; clear:both; }

The Comments Box When Signed Into Facebook

The Comments Box When Signed Into Facebook

The Comments Box When Not Signed Into Facebook

The Comments Box When Not Signed Into Facebook

Reference: Comments — Facebook Developers