How to Add a Follow Me on Twitter Link to Your Posts

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:

Follow Me on Twitter Link

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.

Twitter
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:

< ?php the_content(__('Read more', 'studiopress'));?>

Immediately after that, place this code:

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.