Using the following lines of code, you will be able to count retweets in full text.
1 2 3 4 5 6 7 8 9 10 | function tweetCount($url) { $content = file_get_contents("http://api.tweetmeme.com/url_info?url=".$url); $element = new SimpleXmlElement($content); $retweets = $element->story->url_count; if($retweets){ return $retweets; } else { return 0; } } |
Now copy and paste the following lines of code in your theme’s single.php file.
1 2 | $rt = tweetCount(get_permalink()); echo "Retweeted ".$rt." times."; |
Snippet Source/Credit: WPRecipes