Plugins for buttons like Tweet This and Facebook Share, are not very reliable. we have used a plugin for adding a Tweet Button into my posts, and it really did not work that well. The twitter count goes wild, our posts were not Tweeted once but the Twitter button showed that there were 7 tweets. So I got rid of the previous button. Here is how you can add the Official Twitter Tweet button to your WordPress blog with the Hybrid theme.
Step 1: Find and download post.php
From your Web Host’s File Manager go to public_html/wp-content/themes/hybrid. Here a file named post.php will be located. Download that file and open it for editing.
Step 2: Coding.
Once you have opened post.php look for the following lines of code. Simply copy the following line and press Ctrl+F to search the document for this code.
<?php the_content(); ?>
Now replace it with this code:
<div style="float:left; padding-left:0px; padding-top: 1px;"><a href="http://twitter.com/share" data-count="horizontal">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div><?php the_content(); ?>
The code stated above will add a Horizontal Tweet button on the top right side of all your posts, just like the one I have. If you want the vertical button simply replace the word ‘horizontal’ with ‘vertical’ and if you don’t want a count to appear with the button replace ‘horizontal’ with ‘none’. If you want the Tweet button to appear on the right side of your posts replace float:left with float:right. For adding the Tweet Button to the end of your posts, replace:
<?php the_content(); ?>
with this code:
<?php the_content(); ?><div style="float:left; padding-left:0px; padding-top: 1px;"><a href="http://twitter.com/share" data-count="horizontal">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div>
After editing the file save it and upload it to public_html/wp-content/themes/hybrid. All that is left now is for you to open one of your blog posts and see if there is any problem.
How was your experience of adding the Tweet Button? Let us know by commenting below.
We, Shahan (left) and Farhan (right), are students, tech junkies, gaming enthusiasts and teenage bloggers from Pakistan.