Since past few days, everyone out in the blogosphere has been expressing their thoughts and predictions about the first ever official twitter button. And over here in WordPress.com network, today we have been talking about the latest Theme Extra that adds the official twitter button at the end of your single blog posts. This is a much-anticipated service among WordPress.com users and I believe more social media buttons should be added to the list.
We have been enjoying new addition to the Appearance > Extras being rolled out by the folks at WordPress.com. And we really appreciate it. ๐
Now, a lot of people have been asking about how to insert this official twitter button on their self-hosted blogs. They are seeking a plugin to do so, although there are lots of retweet plugins available out there.
Let’s insert Official Twitter button to self-hosted WordPress
For everyone interested in trying out this new tweet button, I’m giving you the code below to inject in the core theme file of your self-hosted WordPress.
In today’s post, I’ll show you how to add that official twitter button to your self-hosted WordPress blog inside each individual post. The button will be shown up when a post is individually open (not the homepage or any archive). So, let’s begin:
- First of all, you need to log in to your dashboard and open “Appearance > Editor”. Make sure that you are editing the currently active theme (look upper right corner to see if the current theme is selected).
- In the right hand side, you’ll see a list of core files that your theme came with. Look for Single Post (single.php) and click it.
- Now we will inject the tweet button. Open up Single Post (single.php) and look for
<?php the_content(); ?>
- It is your choice where you will paste the button. In this post, I’ll show you inserting it in the left side below the title.
- Right above this, paste the following:
- Note: You may show the data count in horizontal format, too. Just replace the text vertical with horizontal and you’re done. Also remember to replace YOUR TWITTER USERNAME HERE with your twitter username (without the @, of course).
- Update this file.
Now, visit a single post in your blog and you should see a button that reads “Tweet” right below the title of your post. Congratulations (if you’re seeing this)! You now have the official twitter button added to your self-hosted WordPress blog.
So, did you succeed?
Let me know if you were successful in setting up the official twitter button on your self-hosted. Also remember to give me the link to your self-hosted in the comment field below so that I can have a look.
Courtesy by: My Technology Blog A. I. Sajib where I write about how to blog in a better and more appealing way that attracts visitors, gains traffic and earns money.