Answer the question
In order to leave comments, you need to log in
How to display the total number of AddThis page likes in Wordpress?
AddThis has an open API for total page likes (the sum of the likes of all supported social networks).
It looks like this api-public.addthis.com/url/shares.json?url=http://...
How to display the total number of likes for a Wordpress page? As an example, I take the number of comments that is displayed out of the box.
Answer the question
In order to leave comments, you need to log in
To display the number of likes for a particular page:
<?
$likes=json_decode(file_get_contents('http://api-public.addthis.com/url/shares.json?url=http://toster.ru/q/296028'));
?>
<?=$likes->shares;?></li>
<?
$likes=json_decode(file_get_contents('http://api-public.addthis.com/url/shares.json?url='.$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI']));
?>
<?=$likes->shares;?></li>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question