Skip to content

Instantly share code, notes, and snippets.

@patrickwelker
Created January 23, 2013 17:36
Show Gist options
  • Save patrickwelker/4610722 to your computer and use it in GitHub Desktop.
Save patrickwelker/4610722 to your computer and use it in GitHub Desktop.
Simple social share buttons for WordPress. It's worth a mention that if you use certain themes, they might use a special `%permalink%` and `%post-title%` structure. Be sure to replace the default `<?php the_title(); ?>` and `<?php the_permalink(); ?>` with it. #Facebook #Twitter #Google+
<a title="Share" href="http://www.facebook.com/sharer.php?u=<?php the_permalink();?>&t=<?php the_title(); ?>">Share on Facebook</a>
<a title="Tweet" href="https://twitter.com/share?url=&text=<?php the_title(); ?>: <?php echo urlencode(get_permalink($post->ID)); ?> &via=YOUR-TWITTER-USERNAME&count=horizontal">Tweet This</a>
<a title="PlusOne" href="https://plusone.google.com/_/+1/confirm?hl=en&url=<?php the_permalink(); ?>">+1</a>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment