I'm using a code i found in the Internet to count Facebook shares, but I'm not able to call the permalink I'm using.
The function:
<?php
$facebook_like_share_count = function ( $url ) {
$api = file_get_contents( 'http://graph.facebook.com/?id=' . $url );
$count = json_decode( $api );
return $count->shares;
};
?>
The call:
<?php echo $facebook_like_share_count( 'http://www.someurl.com' ); ?>
My permalink:
<?php the_job_permalink(); ?>
I tried many ways and none worked.