WordPress ShareThis Plugin Shortcode

I’ve used the sharethis wordpress plugin for quite some time now. As a web designer and someone who is constantly working on new themes it’s been a pain not to have a shortcode to display the buttons.
Thanks to wordpress we can use the functions.php file of your default theme to create are own shortcode to do the trick!

// custom sharethis shortcode
if (function_exists('st_makeEntries')){
add_shortcode('sharethis', 'st_makeEntries');
}

That’s it, just use [sharethis] on your post or page to get those buttons!

Or for you more advanced users, you can use the following code in a template file of your theme:

<?php echo do_shortcode('[sharethis]'); ?>

Hope this helps someone 🙂

Comments 4

  1. I’ve successfully used this code (added to the functions.php file) in the past, including successfully adding it back in each time I’ve updated the WordPress theme. But since I’ve upgraded to WordPress 3.8 I can’t get the shortcode to work. Any idea how to remedy this?

Leave a Reply

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