Latest Tech and Tips

How to Add Retweet Text with Tinyurl in WordPress Posts

0

Ever because we published our WordPress overview to Twitter Anywhere Platform, we have actually been obtaining demands concerning how to immediately produce message tweet text in the real-time tweet box. In this write-up, we will certainly reveal you how you can add tweet text with Tinyurl in WordPress posts. We will certainly make use of the tinyurl API to produce brief link for your message and also show it with the text.

First open your motif’s functions.php data and also paste the complying with codes:

feature getTinyUrl($ url) {
$ tinyurl = file_get_contents("http://tinyurl.com/api-create.php?url=".$url);
return $tinyurl;.
}

This feature will certainly enable us to produce tinyurls for your WordPress posts.

Then open your website’s footer.php and also add the complying with code right over the closing body tag, OR you can add it in your website’s header.php prior to the closing head tag:

<< manuscript src ="http://platform.twitter.com/anywhere.js?id=YourAPIKey&v=1" kind ="text/javascript"><> .
<< manuscript kind ="text/javascript">>.
twttr.anywhere( onAnywhere Load);.
feature onAnywhere Load( twitter) {
// set up the @Anywhere setting.
twitter("#custom-tweetbox"). tweetBox( {
tag: "Retweet:",.
defaultContent: "<