Create Twitter buttton and Open pop-up onclick for Twitter share

How to add a twitter button to your website and open pop-up on click on button for twitter share.
In wordpress you can add twitter share button with the help of twitter share plugin but we are writing code snippet for you to add Twitter button for twitter sharing.

Yes, really, that’s all it takes. Give your link some design love and tada! Your very own custom Twitter button.

Opening the Twitter Share Box in a popup window

To show the Twitter Share Box as a popup, simply add some lines of javascript to open the link in a new window. Here’s an example using jQuery:

Note: This is just an example. You’ll probably want to put the javascript code in a .js file and call it on document ready.

Setting a default message for the tweet

You can set a default text for the tweet adding a text parameter to the link:

Now when your users click on your Tweet link, the message “This is so easy” will appear in the tweet box by default.