Home SEO Tools FAQs Guest post Contact Donate

Adding official Twitter follow button to Blogger

| 28 comments

official twitter follow button

Make it easier for your blog visitors to follow you on Twitter by adding Twitter Follow button to your blog.

The Twitter Follow Button lets them follow you straight from your blog, without having to visit Twitter.  All it takes is just one click (if they are logged in).

The button comes with (optional) followers count. Visitors can also see your profile and latest tweets by clicking the button.

Let us proceed with the tutorial:

  1. Go to Design > Page Elements.
  2. Click Add A Gadget and select HTML/Javascript gadget.
  3. Copy the code below and paste it inside the content box:
    <!-- Twitter follow button start -->
    <a href="http://twitter.com/USERNAME" class="twitter-follow-button">Follow @USERNAME</a>
    <script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
    <!-- Twitter follow button end -->

    • Replace USERNAME with your Twitter handle (username).
    • If you’re already using a Tweet Button on your blog, you won’t need the Twitter widget Javascript (code line 3). Remove it.
  4. Configure button  

    You can configure the look of the Follow button by adding link data-attributes (next to class="twitter-follow-button") in line 2. Refer to the list below:

    Description Appearance Data-attribute
    Default twitter follow button default  
    Don’t show followers count  follow button no followers count  data-show-count="false"
    Don’t show Twitter handle twitter follow button no screen name data-show-screen-name="false"
    Large button (shown here without count) twitter follow button large data-size="large"
    Align button to the right twitter follow button default data-align="right"

  5. Save the widget and view your blog.
  6. Do test the button to make sure if it works.

Here’s a live demo example:

and the code for it:
<!-- Twitter follow button start -->
<a class="twitter-follow-button" href="http://twitter.com/BloggerSentral" data-show-screen-name="false" data-size="large">Follow @BloggerSentral</a>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
<!-- Twitter follow button end -->

Enjoy!

Update Jan 2012: Update code and attributes, and add demo.

28 comments to "Adding official Twitter follow button to Blogger"

Nur Misnan June 18, 2011 5:19 PM    

wohoooo... must try this button
thanks BS

For some reason it doesn't work for my blog. It messes with how my blog looks. Something about the code.

Greenlava June 19, 2011 2:39 AM    

@Blog This Link
You're right about the code...thanks for bringing it to my attention.
I've fixed it though. You can retry now.

Admin June 19, 2011 12:06 PM    

Thanks.. I ve put this on my blog and It works. I ve been searching for this type of button.
Click here to watch live on my blog

http://jerinshahablog.blogspot.com June 19, 2011 1:51 PM    

thanks for a nice post.i am try it and done.

हिमांशु । Himanshu June 19, 2011 5:57 PM    

Thanks for this button.

NYC, Style and a little Cannoli June 19, 2011 7:22 PM    

is there a way to make the followers be underneath the follow twitter sign? my followers number is cut off on the edge?

Greenlava June 19, 2011 7:41 PM    

@NYC, Style and a little Cannoli
I'm afraid you can't. The only option now is to widen the sidebar, or remove the followers count.

nizam June 20, 2011 6:39 PM    

how about page load? it's effect page load or not?

zulkbo June 21, 2011 12:55 AM    

salam..
very nice entri
very useful
:)

Greenlava June 21, 2011 3:13 PM    

@nizam
Of course it puts additional load to your blog, but I don't you'll even notice it.

Nash July 1, 2011 4:15 PM    

This was really helpful...Thanks! :)

adetruna July 13, 2011 8:28 PM    

this is what i've been looking for - thx!

Andrew August 20, 2011 5:23 AM    

Perfect! Best guide out there.

Esdras C. August 22, 2011 9:47 AM    

Thank you very helpful.

Ben Racicot August 22, 2011 11:08 PM    

What about combining this "Follow" button under the "Retweet" button in your floating social sidebar?
@ http://www.bloggersentral.com/2010/07/install-floating-social-media-buttons.html

thanks!

Greenlava August 23, 2011 11:59 AM    

@Ben Racicot
You can't hide/remove the username part of the button (because the button lies inside an iframe), hence the button won't fit in the floating bar.

Dapo October 9, 2011 12:22 AM    

This rocks..am gonna try it

Gembul October 16, 2011 9:09 PM    

Excellent advice, thanks!

khairilnst November 18, 2011 5:06 PM    

nice, must try ! :)

Nat December 17, 2011 3:42 AM    

Need help adding twitter handle to tweet button in html.

Greenlava December 17, 2011 11:36 PM    

@Nat
Just replace the word USERNAME with acooknotmad in both places in line 2.

Lok Bahadur Thapa December 20, 2011 5:25 PM    

i tried in my another blog and works well...thanks for such a helpful idea :)

Ravi Jindal January 23, 2012 4:09 AM    

Nice Info, Thanks for Sharing, I'm loving Blogger Sentral :)

Wayne February 3, 2012 10:54 PM    

I love it thanks for offering the best stuff ever for my website!

Alex @ Is It Amazing? February 16, 2012 7:58 AM    

Thank you! This helped so much!

Kang Topjer February 25, 2012 12:34 AM    

thanks for great tutorial, keep sharing brot

ignored_genius April 12, 2012 4:55 AM    

thanks for the tip ! :)

We love to hear from you! Leave us a comment.

To ensure proper display, HTML/XML/Javascript need to be escaped first using this escape tool. Then paste the escaped code here.

If your question is unrelated to this article, please post on our Facebook page.

Pls share this page

Get this
Click to go to top Click to comment