Create Your Own ‘Tweet This’ Without A Plugin
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.
Leave a Reply
27 Responses to “Create Your Own ‘Tweet This’ Without A Plugin”
-
BackType Tweetcount + Su.pr = My Retweet Button of Choice - ChurchCrunch
[...] 1. I can host the URLs on my own blog. Previously I had been using the ?p= way of doing things and it was just getting a big ugly to look at. In addition, I still wanted to be able to have that brand name recognition in the link. I’ve outlined my reasoning behind that here. [...]
-
Joel Nagy .com » Make Your Own Short URLs with Wordpress | web technology is a way of life
[...] == 1 || $force) return $wp_query->post->ID; return ''; } You can also add this code for tweeting the short URL (via [...]






very helpful!
Dumb question… How to I use this in my WordPress blog? I'm a NOOB
more ninja tricks
thank you so very much! really appreciate everything you are up to!
Does feedburner have a "tweet this" option where there is the email and facebook option? that would be helpful…
feedburner doesn't. but you can create them…
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,
Stupid question, but are you pulling something similar off with all the other social networking sites you list below each post?
quick answer is yes.
Also for Textpattern users it would be like: <a href="http://twitter.com/home/?status=<txp:title /> – @username <txp:permlink />" class="external" title="Tweet <txp:title /> (New Window)"><img src="http://www.foo.com/images/icons/twitter-icon.png&... alt="Tweet <txp:title />" /></a>
Woops that was an epic fail.
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?
can you show me where you implemented?
Hey John
http://www.growthtrac.com/artman/publish/turning-...
Scroll down to the "Tweet" banner …
Actually, the spaces are translated as literal "%20" — not sure why.
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…
I am not a CSS ninja
John BUMP Please see earlier post. Thanks.
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.
When incorporating this, how would I auto-include a hashtag?
Just add it to the tweet code I suppose…!
I meant the what would the code be , but I figured it out. Thanks.
ah. whoops.
how to do without php? on a static site
you can google that. lots of answers to that!