There are many ways to enhance the way your blog or website looks. A common question we receive here at StudioPress is how to add a follow me on Twitter link posts. This is something that is very easy to accomplish by following the steps below.
Here’s an example of the Follow Me on Twitter link at the end of a post:

Step #1
You’ll need to establish a class of CSS for the link. Add this to your theme’s stylesheet:
.follow-me {
background: url(images/twitter.png) no-repeat left center;
padding: 2px 0px 2px 20px;
}
You’ll notice that this CSS defines the link class you will use, and that an image is associated with it which is set as a background image. You’ll need to upload an image to your theme’s images directory on your server in order for it to show. Below is a sample image you can use for your Follow Me on Twitter link – you can right click and save image as.

Step #2
The next thing you will need to do is open up your theme’s index.php file and look for the content call:
Immediately after that, place this code:
Follow Me on Twitter
Make sure you replace “username” in the code above with your own Twitter username. Keep in mind that this tutorial was written for StudioPress “classic” themes – if you want to add a Follow Me on Twitter link to your post, check to see if your theme has a single.php file. If it does, use that file instead of index.php in Step #2.
Good Article!
Excellent tut. Brian, this is very handy to add a follow me after each post, seeing as different posts can potentially attract different people, depending on their interests.
Thanks
de P
You bet – I knew it would be easy to write this up, and figured a lot of folks would benefit from it!
Brian this is great! I’ve done this and it shows on my posts, however it’s caused the comments boxes to move up towards the sidebar in FF. Is this happening for anybody else?
Hey Michelle – sorry about that, I placed the wrong code above. Change this:
Follow Me on TwitterTo this:
Follow Me on TwitterOne too many div’s
Thanks Brian. I knew it would be an easy fix – all good now!
Thank you Brain – this is awesome, it works charm, myself and my clients are all love this little script .. Happy New Year 2010 !
Hey Ann – Happy New Year to you as well, and glad to hear that it worked!
Thanks for this – it works perfectly…brilliant stuff.
Great Julie, glad to hear that!
This is great advice, Brian. We have added these links to most pages our our site, in addition to our Twitter feeds on some pages. I also plan to retweet this post for you.
Thanks for the tip, works like a charm!
Great news Cyndi – looking forward to WordCamp Boston!
Nice tip – I’ve just launched my first site using a Studiopress theme, and this will come in handy as I spend a lot of time using Twitter and get a fair amount of traffic from it to my existing sites…
Great Dan – glad to hear it, and well done on the site!
Hi,
thanks for the post. I had this working beautifully until I upgraded to WP 2.9.1 at which point it stopped working. I’ve checked the code and it’s all still in place. Has anyone else had the same problem?
I can’t figure it out
Thanks,
Craig.
Can you provide a link to your site so we can see what’s going on?
Thought I had… sorry
craigt.co.uk/blog
Thanks,
Craig.
So both the css files and the single or index.php file has the appropriate code? Hard to really help since it’s not our theme, but it’s possible the update affected your theme in some way.
Thanks for looking anyway.
Yes, both CSS and both index and single PHP files have the correct code. I might change themes and see if I can kick some life into it.
Thanks again,
Craig.
Brian,
thanks for the tip
is there a way to call this code relevant to specific authors? — similar to an author box — this way the twitter link would be specific to that particular author — it would be ideal if we could include / place code within the authorbox
thanks in advance / steve
errrr how do i use block quotes here so that it will show the php for the user code..errrrrr
Wrap whatever you want to wrap in tags that look like this:
Brian,
Thanks for the info. This was pretty cool. One question. I’m using Apture with auto-enhance existing links and it seems to mess this up a bit. Have you worked with Apture? Do you know how I can modify the script above so it won’t auto-enhance this link?
Thanks,
Aaron
Eventhough it is a very easy and quick way for people to retweet, it is limiting the readers only to Twitter versus share this or other methods of social linking. I like this and use it but wonder what others think about this feature. With the “share this” or other methods you let the readers go to digg, delicious, twitter etc. I do not like when bloggers sometimes keep a share this link and have all the possible shareable options in there (like add this) and that confuses or puts off some readers.
What do others think and have experienced.
NENM
I am also a Starbucks addict and it is my virtual office where I can meet clients. I found you company (funny enough) from a site that was being sold on Flippa they were using one of your themes. Like your templates.
Gotta love that Starbucks office!
Nice. Thanks Brian. Also thanks for adding the info on how to do it on non StudioPress sites.
Hey Brian, I am in my Main Index Template (index.php) file and the only code showing is:
<?php
/**
*
*/
genesis();
Am I in the wrong file? The Main Index Template is the only one designated with the (index.php).
This article is not meant for Genesis. You are trying to use a guide that was created for our “classic” themes & is a year old.
Ask in the Support Forum for suggestions on how to do this.
Thanks Craig.