Skip to content

Instantly share code, notes, and snippets.

@billerickson billerickson/single.php Secret

Last active Dec 11, 2015
Embed
What would you like to do?
<?php
/**
* Facebook Comments
*
*/
function be_facebook_comments() {
echo '<h2>Submit a Comment</h2>';
echo '<div class="fb-comments" data-href="' . be_production_url( get_permalink() ) . '" data-numposts="5" data-width="100%"></div>';
}
add_action( 'genesis_after_entry', 'be_facebook_comments' );
remove_action( 'genesis_after_entry', 'genesis_get_comments_template' );
/**
* Facebook Comment Moderators
* Use this to find your ID: http://findmyfbid.com/
*/
function be_facebook_comment_moderators() {
echo '<meta property="fb:admins" content="12345678"/>';
}
add_action( 'wp_head', 'be_facebook_comment_moderators' );
/**
* Production URL
* Helper function to always reference live URLs
*/
function be_production_url( $url ) {
$production_url = 'https://clientsite.com';
$dev_urls = array(
'http://localdev/clientsite',
'http://clientsite.staging.wpengine.com',
);
return str_replace( $dev_urls, $production_url, $url );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.