I want to embed a social sharing button in the theme. Following is the standard code to embed the twitter button.
<a href="https://twitter.com/share" class="twitter-share-button">Tweet</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>
However, WordPress recommends to use the wp_enqueue_script
to include any kind of javascript code. So I am wondering how can I include the above script code properly in a WordPress theme?
Thanks.