| name | language | licence |
|---|---|---|
| Display a Pages Menu in your Sidebar | PHP | BSD |
| Display an External RSS Feed | PHP | BSD |
| Display Recent Posts | PHP | BSD |
| Display Blogroll Links | PHP | BSD |
| Display Archives in a Drop-Down Box | PHP | BSD |
| Display PHP on a Single Page | PHP | BSD |
| TINYURL ON EVERY WORDPRESS-POST | PHP | BSD |
| Display an External RSS Feed | PHP | BSD |
< 1 2 3 4 5 6 7 8 9 >
language: PHP
licence: BSD
TINYURL ON EVERY WORDPRESS-POST
options: view full snippet • send to code collector
//Just go to design > theme editor > functions.php and add this function
function getTinyUrl($url) {
$tinyurl = file_get_contents("http://tinyurl.com/api-create.php?url=".$url);
return $tinyurl;
}
//In the theme editor > single.php you can add this line where ever you want to show the link to the tidyURL.
<?php
$turl = getTinyUrl(get_permalink($post->ID));
echo ‘Tiny URL: <a href="’.$turl.‘">’.$turl.‘</a>’;
?>



library
buttons (3)
wp (93)