Skip to content

Instantly share code, notes, and snippets.

@gyrus
Created July 1, 2013 11:03
Show Gist options
  • Save gyrus/5899980 to your computer and use it in GitHub Desktop.
Save gyrus/5899980 to your computer and use it in GitHub Desktop.
Social media icons for use with ShareThis plugin, including flag to distinguish between "global" sharing of site and individual page sharing.
/**
* Output social media icons
*
* @param bool $global Global style?
* @return void
*/
function pilau_share_icons( $global = false ) {
$url = '';
if ( $global ) {
$url = ' st_url="' . home_url() . '"';
}
?>
<ul>
<li class="facebook"><span class="st_facebook_custom" tabindex="0" title="<?php _e( 'Share on Facebook' ); ?>"<?php echo $url; ?>>Facebook</span></li>
<li class="twitter"><span class="st_twitter_custom" st_via="[Twitter username]" tabindex="0" title="<?php _e( 'Share on Twitter' ); ?>"<?php echo $url; ?>>Twitter</span></li>
<li class="google"><span class="st_plusone_custom" tabindex="0" title="Share on Google Plus"<?php echo $url; ?>>Google+</span></li>
<li class="email"><span class="st_email_custom" tabindex="0" title="<?php _e( 'Share by email' ); ?>"<?php echo $url; ?>>Email</span></li>
<li class="share"><span class="st_sharethis_custom" st_via="[Twitter username]" tabindex="0" title="More sharing options..."<?php echo $url; ?>>More sharing...</span></li>
</ul>
<?php
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment