Skip to content

Instantly share code, notes, and snippets.

@jimmynotjim
Created March 11, 2013 18:12
Show Gist options
  • Save jimmynotjim/5136312 to your computer and use it in GitHub Desktop.
Save jimmynotjim/5136312 to your computer and use it in GitHub Desktop.
Facebook Comments w/ Wordpress
<?php
/*
* If the current post is protected by a password and
* the visitor has not yet entered the password we will
* return early without loading the comments.
*/
if ( post_password_required() )
return;
?>
<?php if ( comments_open() ) : ?>
<div id="fb-root"></div>
<script src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script>
<section class="comments">
<h2>Leave a comment</h2>
<div class="fb-comments" data-href="<?php echo get_permalink(); ?>" data-num-posts="4" data-width="570px"></div>
</section>
<?php endif; ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment