Need help? Check out our Support site, then

Twitter follow button

  1. I am trying to add the twitter follow button using the text widget. I have tried the method at the following link, but it does not seems to be the correct way :

    I also tried adding the button using the twitter html, provided at :

    The html they provided is :

    <a href="" class="twitter-follow-button" data-show-count="false" data-size="large">Follow @jasminder21</a>
    <script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);;js.src=p+'://';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');</script>

    The second one seems to be fine, but it is not having any CSS. It just displays the simple text, without any CSS.

    How can i add the twitter follow button then ?

    The blog I need help with is

  2. Hi,

    Shortcodes (the [twitter-follow screen_name='wordpressdotcom'] style of code) won't execute in widgets, only posts/pages, which is why it isn't working for you.

    The second, Twitter provided code, isn't working as expected since script elements aren't supported on out of security concerns.

    My first suggestion would be to use the Twitter Timeline Widget ( ).

    Another alternative would be to add an image widget with a Twitter icon that you choose.

    I wish I had the dead on answer for you, but hope one of those solutions is workable.


  3. Hey kraftbj, thanks for your reply.

    Could you please confirm that the "Shortcodes " style will not work even if i paste them into my post ?

    If it can work, can what settings i have to make as it did not seemed to work in my case, when i tried inside the blog post, rather then a widget...

  4. Hi,

    Shortcodes will work in pages and posts. They will not work in a text widget.

    I just tried [twitter-follow screen_name='wordpressdotcom'] in a test post of mine and worked without issue. All you need to set is your twitter name within single quotes (replacing wordpressdotcom).


  5. I'm going to back myself up a bit. The shortcode is working for me in a text widget (generally, short codes don't, but I misunderstood on this one apparently).

    One thing to be sure of is that you're using straight quotes like ' ' and not "curly" quotes that are sometimes rendered.

  6. Thanks kraftbj...

    I added the "Text" widget with the short code of the follow worked...

    Thanks once again.

Topic Closed

This topic has been closed to new replies.

About this Topic