Skip to content

Instantly share code, notes, and snippets.

@theJasonJones
Created March 25, 2016 21:39
Show Gist options
  • Save theJasonJones/33442a4642a76d8241b0 to your computer and use it in GitHub Desktop.
Save theJasonJones/33442a4642a76d8241b0 to your computer and use it in GitHub Desktop.
Add
<?php
function getBitly($url) {
$bitly = file_get_contents("http://api.bit.ly/v3/shorten?login=yourbitlyusername&apiKey=yourbitlyAPIkey&longUrl=$url%2F&format=txt");
return $bitly;
}
?>
//Facebook
<a href="http://www.facebook.com/sharer.php?u=<?php the_permalink();?>&amp;t=<?php the_title(); ?>" title="Share on Facebook."></a>
//Reddit
<a href="http://www.reddit.com/submit?url=<?php the_permalink(); ?>&amp;title=<?php the_title(); ?>" title="Vote on Reddit"></a>
//LinkedIn
<a href="http://www.linkedin.com/shareArticle?mini=true&amp;title=<?php the_title(); ?>&amp;url=<?php the_permalink(); ?>" title="Share on LinkedIn"></a>
//Pinterest
<a href="http://pinterest.com/pin/create/button/?url=<?php the_permalink(); ?>&media=<?php $url = wp_get_attachment_url( get_post_thumbnail_id($post->ID) ); echo $url; ?>"></a>
//Twitter, well almost.
<a href="http://twitter.com/home/?status=<?php the_title(); ?> - <?php the_permalink(); ?>" title="Tweet this!"></a>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment