在WORDPRESS中创建帖子的小URL
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了在WORDPRESS中创建帖子的小URL相关的知识,希望对你有一定的参考价值。
Creates a tiny url for posting on twitter etc.
//place in functions.php in theme folder <?php function getTinyUrl($url) { $tinyurl = file_get_contents("http://tinyurl.com/api-create.php?url=".$url); return $tinyurl; } ?> //call the function on the page <a href="http://twitter.com/home?status=Currently reading <?php the_title(); ?> : <?php $turl = getTinyUrl(get_permalink($post->ID)); echo $turl ?>" title="Tweet this">Twitter link</a>
以上是关于在WORDPRESS中创建帖子的小URL的主要内容,如果未能解决你的问题,请参考以下文章