Use Facebook Comments for Comment Count

Featured in: Adding Facebook Comments

/**
 * Facebook for Comment Count 
 *
 * @author Bill Erickson
 * @link https://www.billerickson.net/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 );

Bill Erickson

Bill Erickson is the co-founder and lead developer at CultivateWP, a WordPress agency focusing on high performance sites for web publishers.

About Me
Ready to upgrade your website?

I build custom WordPress websites that look great and are easy to manage.

Let's Talk