How to Add Facebook Comments to WordPress

This document is deprecated! The information on this page refers to a Thesis version that is now obsolete. Please visit the Thesis Docs for current documentation.

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="https://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