A number of people have asked me about how I created the neat little “Tweet This Post” on each post (twice, one for the twitter-bird and the other via a text-link).
It’s actually super easy, so easy in fact that even you can do it.
But perhaps more important is the reasons why I did it.
They are as follows:
- I try to use as little plugins as humanly possible because each plugin adds additional weight to the pages and some are super-inefficient in terms of calls to the mySQL database, etc. If you create the same functionality without a plugin you should do it.
- Typically people use URL Shorteners to Tweet people’s posts, which is great and very useful, but the problem is that they give “brand awareness” to the URL Shortener and not the actual blog itself. I wanted to make sure that I can have as much brand awareness as possible, so every time someone throws up a link to ChurchCrunch they actually see “ChurchCrunch.” The only catch here is that I have a decently sized URL, while some of you may have very long URLs, which doesn’t really help.
- I like rolling my own functions. They are faster, more efficient, and just as effective. In addition, I’m guaranteed that they won’t “break” because I made them myself.
So, here’s how to do it:
<a rel="nofollow" target="_blank" href="http://twitter.com/home/?status=Just Read : <?php the_title();?> : http://ChurchCrunch.com/?p=<?php the_ID(); ?>">Tweet This Post!</a>
Pretty easy, huh? Just change out the bolded areas with whatever you’d like.
Have fun! Let me know if you use it.
tonysteward says
very helpful!
George Hicks says
Dumb question… How to I use this in my WordPress blog? I'm a NOOB ๐
Jim says
more ninja tricks
stephenbateman says
Does feedburner have a "tweet this" option where there is the email and facebook option? that would be helpful…
human3rror says
feedburner doesn't. but you can create them…
chrissulli says
If I understand the question correctly, yes they do. You can add a twit this option to your feedflare which you can put on your feed as well as on your site. You also have the ability to set different features for the feed and for the site,
Daniel_Berman says
Stupid question, but are you pulling something similar off with all the other social networking sites you list below each post?
human3rror says
quick answer is yes.
Josh Brage says
thank you so very much! really appreciate everything you are up to!
Jim Mueller says
Hey John
Another elegant, simple idea.
Question. We've implemented this on our site — not WP — We've utilized in our content management-published content. We're familiar with the tags, a no-brainer.
HOWEVER… for some reason when the "twitter" url is viewed in the address bar, the following character is inserted where the spaces should be — "%2520"
Of course the actual link is perfect– We've done this sort of thing before with no issues.
Any ideas?
human3rror says
can you show me where you implemented?
Jim Mueller says
Hey John
http://www.growthtrac.com/artman/publish/turning-…
Scroll down to the "Tweet" banner …
Jim Mueller says
Actually, the spaces are translated as literal "%20" — not sure why.
Graham Brenna says
Okay… I'm assuming I have to put it in one of the .php templates on my blog. Which one? Single Post? What part? (I'm using the Simpl3 theme…
Graham Brenna says
I am not a CSS ninja
Jim Mueller says
John BUMP Please see earlier post. Thanks.
Daniel_Berman says
I don't know if you know, but you might want to go easy on John. Check this out for why…..<a href=”http://human3rror.com/2009/04/22/filling-holes/.” target=”_blank”>http://human3rror.com/2009/04/22/filling-holes/.
John will be back on board when he can, but I suspect this blog will pretty much go into autopilot for bit. Lets pray for, support, and appreciate John for all that he's done.
Bobby Shirley says
When incorporating this, how would I auto-include a hashtag?
human3rror says
Just add it to the tweet code I suppose…!
๐
Bobby Shirley says
I meant the what would the code be , but I figured it out. Thanks.
human3rror says
ah. whoops.
๐
neznaechka says
how to do without php? on a static site
human3rror says
you can google that. lots of answers to that!