In this article, our objective is to add a Twitter share button to Blogger blog posts and pages. This button is also known as the Twitter tweet button, which helps blog audiences to share articles on their social media accounts. Generally when you add the Twitter share button to a Blogger blog and have more than one post on the home page then it shares your home page rather than sharing an individual post.

If you want to share the individual post from your home page and want to see the actual post sharing count on the home page, then you should have to do certain changes to the original Twitter share button code to get appropriate results.

How to Get the Original Twitter Share Button Code

You can get the default Twitter share button or tweet button code from Twitter Publish. Access the page directly from the following link: https://publish.twitter.com/?buttonType=TweetButton&widget=Button

Click on the Share Button to get the code.

Customized Twitter Share Button Code

Important notes: › Highlighted code in light yellow color above is an extra part added to default code to get complete our objective. › Must change userid highlighted in green with your Twitter handle. For e.g. our twitter handle is @techprevue. So, we are using techprevue here. You need to use your Twitter handle. › If you wish to display the share count, then the value of data-show-count should be true instead of false.

How to Add Twitter Share Button to Blogger Theme

  1. Go to Blogger Dashboard › Select a blog › Switch to Theme tab
  2. Click on the Customize button › Edit HTML
  3. Now search the theme for data:post.body/
  4. If you want to place the Twitter share button above the post then insert the given code above data:post.body/ or if you want to place the Twitter share button below the post then insert the code below data:post.body/
  5. Paste the following script just abovetag in your theme-

OR

  1. Click on the floppy icon to save the changes

Final Words

After completing all steps explained above, you can find that the Twitter share button works perfectly for each post on your home page and show the count per post. › Other important › Learn how to edit a Blogger theme

How to Add Twitter Share Button to Blog Posts    Blogger Blogspot Guide - 4How to Add Twitter Share Button to Blog Posts    Blogger Blogspot Guide - 75