How to Create Custom Social Share Links


Nowadays, social media sharing is the mostly required for any web projects. Some advantages of the social media sharing are

  • Reduced marketing costs.
  • Increased sales.
  • Increased traffic to your website.
  • Improved ranking on search engines.

There are so many free and easy-to-implement services out there. But all those social sharing plugins are used lot of JavaScript which is increase page load time. So, if you want to customize social sharing button as per your project theme and load page faster, then it will be a good idea to use social share buttons with custom links.

In this short article, we’ll provide custom social share links for some popular social media. Using those links you can create social share button for web page URL sharing without JavaScript.

Facebook Custom Share Link:

http://www.facebook.com/sharer.php?u=[EncodedURL]

Google+ Custom Share Link:

https://plus.google.com/share?url=[EncodedURL]

Twitter Custom Share Link:

http://twitter.com/share?text=[TITLE]&url=[URL]

LinkedIn Custom Share Link:

http://www.linkedin.com/shareArticle?mini=true&url=[EncodedURL]

StumbleUpon Custom Share Link:

http://www.stumbleupon.com/badge/?url=[URL]

Pinterest Custom Share Link:

http://pinterest.com/pin/create/button/?url=[EncodedURL]&media=[MEDIA]

Reddit Custom Share Link:

http://www.reddit.com/submit?url=[EncodedURL]

E-Mail Custom Share Link:

mailto:?subject=[SUBJECT]&body=Check out this site [URL]

Insert the above custom social share links into the href attribute of <a> tag. The social share anchor links would be like the below.

<a href="[CustomSocialShareLink]" target="_blank" rel="nofollow">[Social Media Share Text/Image]</a>

If you want to open the share URL on the new window like a popup, JavaScript is required. Make it easy, we’ve created a JavaScript function called genericSocialShare(). genericSocialShare() method takes the custom social share URL and open it in the new window like a popup.
JavaScript

<script type="text/javascript">
function genericSocialShare(url){
    window.open(url,'sharer','toolbar=0,status=0,width=648,height=395');
    return true;
}
</script>

HTML

<a href="javascript:void(0)" onclick="javascript:genericSocialShare('[CustomSocialShareLink]')">[Social Media Share Text/Image]</a>

1 Comment

  1. Cade Said...

Leave a reply

Connect With CodexWorld