Skip to content

Instantly share code, notes, and snippets.

@MrJSdev
Last active March 23, 2017 05:41
Show Gist options
  • Save MrJSdev/e60d4b0fcfe98c744abba606d10bb007 to your computer and use it in GitHub Desktop.
Save MrJSdev/e60d4b0fcfe98c744abba606d10bb007 to your computer and use it in GitHub Desktop.
Facebook comment Count
<?php
/**
* Facebook for Comment Count
* @link http://extracatchy.net/add-facebook-comments-in-wordpress/
*
* @param int $count
* @param int $post_id
* @return int $count
*/
function ea_facebook_for_comment_count( $count, $post_id ) {
if( ! function_exists( 'ea_share' ) )
return $count;
return ea_share()->core->count( $post_id, 'facebook_comments' );
}
add_filter( 'get_comments_number', 'ea_facebook_for_comment_count', 10, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment