Want to Write for Us?Read This | LoginBecome a Member

Create Your Own ‘Tweet This’ Without A Plugin

picture-1-1A 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:

  1. 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.
  2. 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.
  3. 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:

&lt;a rel="nofollow" target="_blank" href="http://twitter.com/home/?status=<strong>Just Read</strong> : &lt;?php the_title();?&gt; : http://<strong>ChurchCrunch.com</strong>/?p=&lt;?php the_ID(); ?&gt;"&gt;<strong>Tweet This Post!</strong>&lt;/a&gt;

Pretty easy, huh? Just change out the bolded areas with whatever you’d like.

Have fun! Let me know if you use it.

26 Responses to “Create Your Own ‘Tweet This’ Without A Plugin”

  1. April 21, 2009 at #

    very helpful!

  2. April 21, 2009 at #

    Dumb question… How to I use this in my WordPress blog? I'm a NOOB :)

  3. Jim
    April 21, 2009 at #

    more ninja tricks

  4. April 21, 2009 at #

    Does feedburner have a "tweet this" option where there is the email and facebook option? that would be helpful…

  5. April 21, 2009 at #

    feedburner doesn't. but you can create them…

    • April 22, 2009 at #

      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,

  6. April 22, 2009 at #

    Stupid question, but are you pulling something similar off with all the other social networking sites you list below each post?

  7. Josh Brage
    April 21, 2009 at #

    thank you so very much! really appreciate everything you are up to!

  8. April 22, 2009 at #

    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?

  9. April 22, 2009 at #

    Hey John
    http://www.growthtrac.com/artman/publish/turning-…

    Scroll down to the "Tweet" banner …

  10. April 22, 2009 at #

    Actually, the spaces are translated as literal "%20" — not sure why.

  11. April 22, 2009 at #

    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…

  12. April 22, 2009 at #

    I am not a CSS ninja

  13. April 23, 2009 at #

    John BUMP Please see earlier post. Thanks.

  14. June 2, 2009 at #

    When incorporating this, how would I auto-include a hashtag?

  15. June 2, 2009 at #

    I meant the what would the code be , but I figured it out. Thanks.

  16. November 5, 2009 at #

    how to do without php? on a static site

    • November 8, 2009 at #

      you can google that. lots of answers to that!

Trackbacks/Pingbacks:

  1. BackType Tweetcount + Su.pr = My Retweet Button of Choice - ChurchCrunch - August 12, 2009

    [...] 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. [...]

  2. Joel Nagy .com » Make Your Own Short URLs with Wordpress | web technology is a way of life - January 12, 2010

    [...] == 1 || $force) return $wp_query->post->ID; return ''; } You can also add this code for tweeting the short URL (via [...]

  3. BackType Tweetcount + Su.pr = My Retweet Button of Choice | Church Mag - May 17, 2011

    [...] 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. [...]

Leave a Reply

Gravatar Image