WordPress.org

Ready to get started?Download WordPress

Forums

WP Super Cache
Facebook Comment Count Refresh (3 posts)

  1. Satiro
    Member
    Posted 1 year ago #

    Hi,
    I've implemented facebook comments count with the traditional wordpress comments count, but unlike it the count dosen't refresh after the comment submission.

    I've used this function to do it:

    // Get combined FB and WordPress comment count
    function full_comment_count() {
    	global $post;
    	$url = get_permalink($post->ID);
    	$filecontent = file_get_contents('https://graph.facebook.com/?ids=' . $url);
    	$json = json_decode($filecontent);
    	$count = $json->$url->comments;
    	$wpCount = get_comments_number();
    	$realCount = $count + $wpCount;
    	if ($realCount == 0 || !isset($realCount)) {
    		$realCount = 0;
    	}
    return $realCount;
    }

    What can I do? Thanks in advance!

    http://wordpress.org/extend/plugins/wp-super-cache/

  2. jeffqc
    Member
    Posted 6 months ago #

    where di you put that function?

  3. Satiro
    Member
    Posted 6 months ago #

    I solved with an ajax call

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic