Skip to content

Instantly share code, notes, and snippets.

@Shelob9
Created December 31, 2012 02:26
Show Gist options
  • Save Shelob9/4416934 to your computer and use it in GitHub Desktop.
Save Shelob9/4416934 to your computer and use it in GitHub Desktop.
Add twitter share button to wordpress theme. Change data-show-count="false" to data-show-count="true" to show follower count https://dev.twitter.com/docs/follow-button
<?php $username = get_the_author_meta('twitter'); ?>
<a class="twitter-follow-button" data-show-count="false" href="http://twitter.com/<?php echo $username; ?>">Follow @<?php echo $username; ?></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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment