Welcome to Macuha.com! Kindly subscribe to my feeds via RSS reader or via e-mail if you want more updates. If you like this blog, be a fan on Facebook!
I call this a Twit This Wordpress Code since it’s not actually a plugin. Hehe. I got this idea after reading John Chow’s post about the Twit This Post Wordpress plugin.
I like the idea. It is indeed a brilliant idea giving your readers an easy way to twit what they’ve read from your blog with a single click of a button. However, as I checked the plugin, it involves too much coding with a dependency to a 3rd party URL shortening service and involves caching of links. Eversince I learned how to shorten my post link without using those services, I never used TinyURL again on linking to my posts in Twitter. Of course, if people are going to link to my post, I don’t want them to use them either. Instead, they must use the shorter link version of my post, thus eliminating the dependency to a 3rd party service.
Since that option is not available on that plugin, I decided to create my own code. Yeah, just a code, not a plugin. Why add a plugin with so much code in it when I can simply have the same function by just adding a simple code?
Ok, here’s the code. Just add it on your single.php code, just below your post.
Just replace @marhgil with your own Twitter ID, macuha.com with your own domain name, and the img src “http://www.macuha.com/Twitter.png” with your own image link. Of course, you can modify the code as you like.
If you don’t want to have an image link, the following code will suffice:
You can see this code in action on this blog.
If you hate tinkering with codes and you don’t mind using a 3rd party service, use that plugin instead. No support will be given when using my code. Use it at your own risk, ok? Who needs support for such a short code? Hehe.
Update: John Chow is now using this code on his blog! Check his shout out here!
Update: You can also add the Twit This link on your RSS feed. Here’s how.
Update: This code is now featured on John Chow’s blog!
Update: I’ve modified the code above to insert the nofollow tag as recommended by John Chow on his post.
Twit This Post!
Plurk This Post!
Download your free Guerilla Bloggers' e-book here!
Bored? Play Pinoy HangARoo!

If you like this post, buy me a beer!

January 24th, 2009 at 5:23 am
aba okay to ah! sinubukan ko, gumana! try ko gumawa ng code pra naman sa blogspot.d gagana un php e.
January 24th, 2009 at 5:47 am
may nakita na ako sa blogspot kaso dun lang pwede ilagay sa page element kasi di siya naappear kapag isinama mo un code sa template mismo. eto yun url http://twitthis.com/?type=image add mo na lang to para sa mga blogspot blogs
January 24th, 2009 at 7:54 am
[...] 24th, 2009 Twit This Wordpress Code a simple php code made my Marhgil of Macuha.com. It is an alternative way of putting a twit this post button or lin after your [...]
January 24th, 2009 at 11:06 am
ma try ko nga din sa blog ko
January 24th, 2009 at 12:57 pm
Ok to matry nga. Thanks again Brother!
January 24th, 2009 at 1:08 pm
Haha. Galing galing! Thanks sa tip marh
January 24th, 2009 at 1:41 pm
Ayus yan ah…
January 24th, 2009 at 2:30 pm
Lol i cant read any of those comments, what lanauge are those? looks like french
January 24th, 2009 at 2:57 pm
When I install the code at first it did not work.. What I did is manually change the ( ” ) mark , I don’t know what happen since when i copied it it seems different.
Maybe other will experience the same.. But it works now..
January 24th, 2009 at 6:13 pm
ayos to ah, pede rin ilagay sa arcade.
January 25th, 2009 at 1:57 am
[...] subscribe to my feeds via RSS reader or via e-mail if you want more updates. If you added the Twit This code on your blog, I think it’s also a good idea to put that same link on your RSS feed. Your RSS [...]
January 26th, 2009 at 7:59 am
[...] just be a simple matter of adding one line of code to the single.php file. Marhgil explained how he did it here. I made a couple changes to clean up the codes a little. <a rel=”nofollow” [...]
January 26th, 2009 at 8:41 am
Good job with the code snippet! Featured sa johnchow pa!
January 26th, 2009 at 1:52 pm
Uy, maraming salamat for sharing this one.
January 27th, 2009 at 10:33 am
[...] John Chow featured my post on his blog. Yeah, the Dot Com Mogul himself dedicated a post for the Twit This code that I [...]
February 2nd, 2009 at 3:25 pm
nice great awesome! thanks! eaufs!
February 3rd, 2009 at 9:42 pm
Thanks for the code!
I’ve edited this and used a nice “tweet this” button I found on the net. Check out this sample
http://noelbautista.com/how-to-use-a-free-ppc-spy-tool-ppcwebspy/
February 4th, 2009 at 11:20 pm
Hey thanks for the tip..
February 28th, 2009 at 2:29 am
Great tip! I’ll be adding it to my blog soon! More power!
March 16th, 2009 at 4:43 pm
[...] have been wanting to put this Twit This Wordpress Code of Marhgil for quite sometime since I read it in his blog and it is just now that I have found time [...]
March 16th, 2009 at 5:57 pm
I just installed the code in my blog and it worked! Thanks for the code!
March 16th, 2009 at 9:45 pm
Installed na din sa blog ko. Thanks!
May 2nd, 2009 at 6:46 pm
Hi Marhgil,
I hope you don’t mind me creating my version of “Twit This Wordpress Code”.
This uses an embedded swf file along with the dynamic link.
See my post here: http://keywordspeak.com/2009/05/keywords-twit-this-wordpress-code/
Thanks
Nhoel of keywordspeak.com
May 8th, 2009 at 4:50 pm
[...] finally, I’ve added the Twit This Wordpress code courtesy of Marghil Macuha, the cute twitter bird image courtesy of TheDesignSuperHero and [...]
May 8th, 2009 at 5:04 pm
I’ve been working from home for some time now and it really is possible to make a great income. In order to find something that is legitimate, you must first understand what you are looking for (e.g. work or business opportunity).
Most online work requires you to have some sort of specialized technical skill sets. You should never pay to start an online job. Any site that requires you to pay to work is definitely a scam. On the other hand, if you are not technically qualified for most online jobs, then your best bet is starting your own home based business. Starting a business does require up front cost.
The quickest way I know to make some extra cash is by selling stuff on ebay or searching craiglist for work- these are normally only short-term fixes. I’ve tried them both and lost interest very quickly.
May 16th, 2009 at 5:43 pm
sir..im trying to do this one but when im starting to test it and click the “Twit This”, i encountered error 404. Hope you could help me with this..thank you so much.
May 27th, 2009 at 12:11 am
sir..hindi po sya gumagana sa blog ko..can u help me out why..after ko ipost ung code..then nung itry ko iclick..eror 404 ang lumalabas..hayyyzzz
May 27th, 2009 at 12:31 am
@Crisiboy try mo copy paste muna sa notepad, then retype all the double quotes. nagkakaproblema kasi sa encoding.