Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
wordpress social sharing functions
shortcode to use: <?php echo do_shortcode('[darkoobweb_social_sharing]') ; ?>
function darkoobweb_social_sharing()
extract(shortcode_atts(array(), $atts));
<div id="social-sharing-container">
<i class="icon-share"></i> اشتراک گذاری:
<a class="social-sharing-icon social-sharing-icon-email" target="_new" href=" '. wp_get_shortlink() .'"><i class="fa fa-telegram">Telegram |</i></a>
<a class="social-sharing-icon social-sharing-icon-facebook" target="_new" href="' . urlencode(wp_get_shortlink()) . '&title=' . urlencode(get_the_title()). '"><i class="fa fa-facebook"> Facebook |</i></a>
<a class="social-sharing-icon social-sharing-icon-twitter" target="_new" href="'. urlencode(get_the_title()). '+'. urlencode(wp_get_shortlink()) . '+ @darkoobweb'. '"><i class="fa fa-twitter"> Twitter |</i></a>
<a class="social-sharing-icon social-sharing-icon-google-plus" target="_new" href="' . urlencode(wp_get_shortlink()) . '"><i class="fa fa-gplus"> Google+ |</i></a>
<a class="social-sharing-icon social-sharing-icon-linkedin" target="_new" href="' . urlencode(wp_get_shortlink()) . '&title=' . urlencode(get_the_title()) . '&source=' . get_bloginfo("url") . '"><i class="fa fa-linkedin"> Linkedin |</i></a>
<a class="social-sharing-icon social-sharing-icon-email" target="_new" href="mailto:?subject=' . urlencode(get_the_permalink()) . '&body=Check out this article I came across '. wp_get_shortlink() .'"><i class="fa fa-mail"></i> Email</a>
add_shortcode("darkoobweb_social_sharing", "darkoobweb_social_sharing");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment