-
-
Save billerickson/eb0e66f1652ebb82b17f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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