ADD TWITTER SHARE BUTTON

To add Twitter share button first you need to add Twitter script at the end of your HTML body

<script>
window.twttr = (function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0],
t = window.twttr || {};
if (d.getElementById(id)) return t;
js = d.createElement(s);
js.id = id;
js.src = "https://platform.twitter.com/widgets.js";
fjs.parentNode.insertBefore(js, fjs);

t._e = [];
t.ready = function(f) {
t._e.push(f);
};

return t;
}(document, "script", "twitter-wjs"));
</script>

Then if you want to pass some text value inside the tweet button.

<a class="twitter-share-button"
href="https://twitter.com/intent/tweet?text=This is example"
data-size="large">
Tweet</a

Example of the button:

For more info you can visit Twitter Dev sites:
https://developer.twitter.com/en/docs/twitter-for-websites/tweet-button/overview

Please follow and like us:

Leave a Reply

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