Add Twitter follow button to WordPress blog

From last few days i was planning to do a lot of modifications in my blog and adding the twitter follow button to wordpress blog was one of them but as a lazy ass i was always skipping it. So,finally today I added it on my blog,so to add twitter follow button I did some research over internet for the best and simplest way in which it can be done. After reviewing all the options like installing a wordpress plugin , installing third party scripts etc , I found that adding it as a widget in your blog will be the most easiest and handy way. Here , I have provided you the source code for 4 different types of button , depending on your site look and feel you can choose any of them.

1. Follow button with total number of followers :

<a href="https://twitter.com/say2saurab" 
data-show-count="true" 
data-size="large">Follow @say2saurab</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>

2.  Follow button but total number of followers won’t be displayed :

<a href="https://twitter.com/say2saurab" 
class="twitter-follow-button"
 data-show-count="false" data-size="large">
Follow @say2saurab</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>

3.  Smaller size follow button with total number of followers :

<a href="https://twitter.com/say2saurab" 
data-show-count="true" 
data-size="medium">Follow @say2saurab</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>

4. Smaller size but total number of follower won’t be displayed :

<a href="https://twitter.com/say2saurab" 
class="twitter-follow-button"
 data-show-count="false" data-size="medium">
Follow @say2saurab</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>

By choosing any of these 4 scripts you can add twitter follow button to wordpress blog without any issue.

Let'sConnect

Saurabh Jain

A Developer working on Enterprise applications ,Distributed Systems, Hadoop and BigData.This blog is about my experience working mostly on Java technologies ,NoSQL ,git , maven and Hadoop ecosystem.
Let'sConnect

One thought on “Add Twitter follow button to WordPress blog

Add Comment Register



Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>