Skip to content

Instantly share code, notes, and snippets.

@aprakasa
Created September 24, 2012 05:11
Show Gist options
  • Save aprakasa/3774281 to your computer and use it in GitHub Desktop.
Save aprakasa/3774281 to your computer and use it in GitHub Desktop.
Simple social share
<!-- Twitter share -->
<a href="http://twitter.com/?status=<?php the_title(); ?>%20<?php echo wp_get_shortlink(get_the_ID()); ?>" onclick="window.open(this.href); return false;">TWITTER</a>
<!-- Facebook -->
<a href="http://www.facebook.com/sharer.php?u=<?php the_permalink();?>&amp;t=<?php the_title(); ?>" onclick="window.open(this.href); return false;">FACEBOOK</a>
<!-- Google plus -->
<a href="https://plus.google.com/share?url=<?php the_permalink();?>" onclick="javascript:window.open(this.href,'', 'menubar=no, toolbar=no, resizable=yes, scrollbars=yes,height=600,width=600');return false;">Google plus</a>
<!-- Pinterest -->
<a href="http://pinterest.com/pin/create/button/?url=<?php the_permalink(); ?>&media=<?php echo catch_that_image();?>&description=<?php the_title(); ?>" class="pin-it-button" count-layout="horizontal">Pin it</a>
<!-- Linked In -->
<a href="http://www.linkedin.com/shareArticle?mini=true&url=<?php the_permalink();?>&title=<?php the_title(); ?>&summary=<?php wp_trim_words( strip_shortcodes( strip_shortcodes( get_the_content() ) ), 25, null); ?>&source=<?php bloginfo( 'name' );?>" onclick="javascript:window.open(this.href,'', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600');return false;">Linkedin</a>
<!-- Reddit -->
<a href="http://reddit.com/submit?url=<?php the_permalink(); ?>&amp;title=<?php the_title(); ?>" onclick="window.open(this.href); return false;">REDDIT</a>
<!-- Digg -->
<a href="http://digg.com/submit?phase=2&amp;url=<?php the_permalink(); ?>&amp;title=<?php the_title(); ?>" onclick="window.open(this.href); return false;">DIGG</a>
<!-- Stumble upon -->
<a href="http://www.stumbleupon.com/submit?url=<?php the_permalink(); ?>&amp;title=<?php the_title(); ?>" onclick="window.open(this.href); return false;">STUMBLE</a>
<!-- Email -->
<a href="mailto:?subject=<?php the_title(); ?>&amp;body=Check out this article! <?php the_permalink() ?>">EMAIL</a>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment