Last active
August 29, 2015 13:56
-
-
Save vermasachin/9321732 to your computer and use it in GitHub Desktop.
Responsive Social Share Buttons Genesis
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** Add custom social share icons **/ | |
add_action( 'genesis_entry_header', 'single_post_social_share' ); | |
function single_post_social_share() { | |
if ( is_single() ) { ?> | |
<div class="social-sharer"> | |
<div class="share-love"> | |
<div class="share-text"><div class="dashicons dashicons-share"></div> Share it!</div> | |
</div> | |
<!-- Facebook Share --> | |
<a href="http://www.facebook.com/share.php?u=<?php print(urlencode(get_permalink())); ?>&title=<?php print(urlencode(the_title())); ?>" target="_blank"><div class="share-facebook"><div class="share-text"><div class="dashicons dashicons-facebook-alt"></div> Share <div class="longtext">on Facebook</div></div></div></a> | |
<!-- Twitter Share --> | |
<a href="http://twitter.com/home?status=<?php print(urlencode(the_title())); ?>+<?php print(urlencode(get_permalink())); ?>" target="_blank"><div class="share-twitter"><div class="share-text-twitter"><div class="dashicons dashicons-twitter"></div> Tweet </div><div class="longtext"><div class="dashicons dashicons-twitter"></div> Share on Twitter</div></div></a> | |
<!-- Google Plus Share --> | |
<a href="https://plus.google.com/share?url=<?php print(urlencode(get_permalink())); ?>" target="_blank"><div class="share-google"><div class="share-text"><div class="dashicons dashicons-googleplus"></div> Share <div class="longtext">on Google</div></div></div></a> | |
</div> | |
<?php } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment