/* add the following codes to functions.php file: */
function getShortUrl($url) {
$tinyurl = file_get_contents("API-URL".$url);
return $tinyurl;
}
// remember to replace API-URL in the second line of the above codes with one of the urls mentioned on the comments
/* On your single.php file, paste the following within the loop: */
<?php
$surl = getShortUrl(get_permalink($post->ID));
echo 'Short Url for this post: <a href="'.$surl.'">'.$surl.'</a>'
?>