Skip to content

Instantly share code, notes, and snippets.


georgiee/social urls

Created Aug 19, 2013
What would you like to do?
How-To: Create Custom Share Buttons For All The Popular Social Services
JUNE 16TH, 2010 | HOW-TO | 72 COMMENTS
For those of you that follow me, you are probably already know that I recently redesigned my post footer. For those that don’t know a post footer is the area just below this post with the “Share It!” and “Related Post” sections. I took it on myself to create a completely custom footer area with share links to many of the popular social services available today. I like my blog to be different from the other gazillion out there, so I choose to minimize my plugin use and create custom solutions.
Most of the popular social service out there offer pre-made javascript buttons that allow you share your pages or articles on their service. While this does make it easy, there is one problem with using their code generating methods; you are stuck with their styles and icons. I wanted to use a custom style with a different set of icons. To accomplish this, I had to take advantage of the services various “URL” submission methods. All the services offer this method, but most of them are poorly documented and are hard to find details on. After spending hours browsing the web for the various “URL” submission methods, I decided that once I finished I would post them all together in one place so people can easily find them and create their own custom share buttons.
Below, I am going to offer you the various services URL’s and teach you how to use them on your site.
Tapiture[IMAGE]&page_url=[URL]&page_title=[TITLE]&img_title=[TITLE]&img_width=[IMG WIDTH]img_height=[IMG HEIGHT]
Google Bookmarks[URL]&title=[title]&annotation=[DESCRIPTION]
Those are the URL's you need to know, now, I know some of you are say what do I do with them? These are the URL you link your social icons too. Replace [TITLE] with the title of the page or article. Replace [URL] with the link back to the page or article. Both of these values need to be URL in encoded for the submissions to process correctly. If you are using php, you can easily URL encode anything with:
<?PHP echo urlencode("VARIBLE"); ?>
If you are using WordPress, you can easily substitue the [URL] and [TITLE] values with WordPress codex functions. Below is the code you can use to replace the [TITLE] value:
<?php print(urlencode(the_title())); ?>
Now, the the code to replace the [URL] value:
<?php print(urlencode(get_permalink())); ?>
Now, lets take a look at it all put together for a general page with a "Share on Twitter" button:
<a href=" is the blog">
<img src="" height="18" width="18" alt="Share On Twitter" />
Now, a wordpress example. This example substitutes the [TITLE] and [URL] values automatically with the current articles information with URL encoding:
<a href="<?php print(urlencode(get_permalink())); ?>+<?php print(urlencode(the_title())); ?>">
<img src="" height="18" width="18" alt="Share On Twitter" />
I hope this helps to you create your very own custom share buttons. If you have any questions, please ask them below and I will answer them to the best of my ability. If I missed a service that you would like me to add, please leave a comment below.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.