Facebook share, like and comment count is ommitted from the front-end
-
Hi Bill, Jared,
There is an error in line 212, 215 and 218 of /includes/class-shared-counts-core.php of version 1.3 that blocks most Facebook counts of being shown on the frontend (like_count, share_count and comment_count are counted as being 0).
I found it when we noticed most blog posts didn’t show shared counts, while the editor reported they had facebook shares, comments and likes. Facebook total count was shown correctly, but we used share_count that wasn’t.
The cause is that the facebook dimension is missing in the statements, so it says $counts[‘like_count’] instead of $counts[‘Facebook’][‘like_count’]. Changing that made it work correctly.
Line 212 should read:
$share_count = isset( $counts['Facebook']['like_count'] ) ? $counts['Facebook']['like_count'] : '0';
Line 215 should read:
$share_count = isset( $counts['Facebook']['share_count'] ) ? $counts['Facebook']['share_count'] : '0';
Line 218 should read:
$share_count = isset( $counts['Facebook']['comment_count'] ) ? $counts['Facebook']['comment_count'] : '0';
Thanks,
Hans
- The topic ‘Facebook share, like and comment count is ommitted from the front-end’ is closed to new replies.