How I can replace most comment by facebook comment

Posted in: Newsmag
Post count: 11

Hello guy,

I want to change most comment from is default count by wordpress comment to facebook comment count, right now I have already changed td-module-comments to show comment count from facebook comment then sort of most comment in widget it not working anymore.

So how I can change sort from wordpress comment ?

I have tried to overdrive count by fb_comments_count it not working

function fb_comments_count( $count )
{
// Override the comment count
if( function_exists( ‘fb_comments_count’ ) )
$count = fb_comments_count();

// We must then return the value:
return $count;
}
add_filter( ‘get_comments_number’, ‘fb_comments_count’);

and this is not working too

function fb_comment_count() {
global $post;
$url = get_permalink($post->ID);

$query = “SELECT comment_count FROM link_stat WHERE url = ‘{$url}'”;
$responseText = file_get_contents(‘https://graph.facebook.com/fql?q=’.$query);
$responseJson = json_decode($responseText);

$commenteCount = $responseJson->data->comment_count;
update_post_meta($post->ID, ‘facebook_comments_count, $commenteCount’);
// …
}

Best Regards,
ZoLKoRn

  • This topic was modified 9 years by ZoLKoRn.
Post count: 6535

Hi

This is a complex task which involve some js customization and many tests in order to be achieved.
We can’t offer speed customization services at the moment so if really need this and you’re not aware of the steps you need to take in this regard please consider hiring a developer or a freelancer to do this for you.

Thanks for your understanding!

Post count: 11

Hello,

Thank you for your reply and I have understood and seem it very complicate.

It okay I don’t really serious about this just try to asking.

BR,
ZoLKoRn

Viewing 3 posts - 1 through 3 (of 3 total)
The forum ‘Newsmag’ is closed to new topics and replies.