Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

Created October 29, 2011 05:39
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/1324140 to your computer and use it in GitHub Desktop.
Save anonymous/1324140 to your computer and use it in GitHub Desktop.
My override functions for sharethis products in woocommerce
function woocommerce_sharethis_script() {
if (get_option('woocommerce_sharethis')) :
if (is_ssl()) :
$sharethis = 'https://ws.sharethis.com/button/buttons.js';
else :
$sharethis = 'http://w.sharethis.com/button/buttons.js';
endif;
echo '<script type="text/javascript">var switchTo5x=true;</script>
<script type="text/javascript" src="'.$sharethis.'"></script>
<script type="text/javascript">stLight.options({publisher:"'.get_option('woocommerce_sharethis').'"});</script>'
endif;
}
function woocommerce_template_single_sharing( $post, $_product ) {
if (get_option('woocommerce_sharethis')) :
echo '
<div class="social">
<span class="st_facebook_button" displayText="Facebook"></span>
<span class="st_twitter_button" displayText="Tweet"></span>
<span class="st_plusone_button"></span>
</div>';
add_action( 'wp_footer', 'woocommerce_sharethis_script' );
endif;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment