Tag: wordpress
Integrate Twitter Buttons in WordPress (with shortened URL)
How to create a “tweet this” button for your blog post in WordPress? You have many options.
Twitter has become a social network sharing system and you should always provide an easy call-to-action for your readers to share your posts. Also, don’t forget to shorten your URL.
The TinyURL Way
There’s a great tutorial on Smashing Magazine. However, the specific code I am providing is modified to work with MediaTemple since MediaTemple doesn’t support file_get_contents. If you use the code on smashing magazine you will get a Warning: file_get_contents() …
Put this code in your function.php file
// Create TinyURL for post to Twitter
function getTinyUrl($url) {
$ch = curl_init();
$timeout = 5;
curl_setopt ($ch, CURLOPT_URL, ‘http://tinyurl.com/api-create.php?url=’.$url);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
$tinyurl = curl_exec($ch);
curl_close($ch);
return $tinyurl;
}
and in your single.php or wherever you want your “Tweet this” button to show up, put in this code:
<a href=”http://twitter.com/home?status=Reading%20@yourusername%20′<?php _e(urlencode(the_title_attribute(‘echo=0′))); ?>’%20@%20<?php …
What’s up with this blog
Back in 2004 I had a blog in wordpress that I kept for a class in university hosted on the school’s server. After graduating I decided to keep blogging and transferred that wordpress blog to my own wordpress. After being around the web industry for a while I decided to transfer my wordpress blog to drupal. The old blog was hosted on everybrandnewday.com (which is now offline). I have gone through many migrations of data and upgrades; however……
Last month I tried to upgrade to drupal 6. I did back up everything like everyone always tells you to. However, when everything failed to work and I was about to revert back to the old database….. That’s when I realized that the database zip file was actually corrupted. It failed to extract. After many struggle and painful times, I decided to …