ArtsAutosBooksBusinessEducationEntertainmentFamilyFashionFoodGamesGenderHealthHolidaysHomeHubPagesPersonal FinancePetsPoliticsReligionSportsTechnologyTravel
  • »
  • Technology»
  • Internet & the Web

Social Sharing Icons For Tumblr Blog Posts

Updated on March 13, 2013
Social Sharing Icons
Social Sharing Icons

So recently I've been thinking about what should I do with Tumblr blog posts, I was thinking about doing some theme improvement but then I thought I should add all the social sharing options using just a few lines of codes. I have been using a template in blogspot I didn't make it but it has some nice social sharing icons, I thought maybe someone could use it in Tumblr. The coding was all for blogspot so I spent a couple of minutes making it compatible for Tumblr. By using these sharing options you just have to post content that your visitors are gonna love and let your visitors share it on their Facebook, Twitter or Google+ networks or do some SEO social bookmarking for your by posting your blog posts on Reddit, Stumbleupon, Digg, Linkedin, Delicious or Technorati.

Implementing the Social Sharing Icons

Using different images is a bit of a headache so I used the original CSS code because there is only one image used with some css coding that makes 'em look like different images. So here is the CSS code:

ul#social-ikonzs,ul#social-ikonzs li{list-style:none;padding:0;margin:0}
ul#social-ikonzs li{float:left;position:relative}
#social-ikonzs a{width:19px;height:20px;display:block;margin:0 3px;background-image:url(http://3.bp.blogspot.com/-GnsWJY-Hblo/UIbck16A3BI/AAAAAAAAGJM/qdog-XGwwQE/h20/sprite+images.png);background-position:0 0;background-repeat:no-repeat}
ul#social-ikonzs li.facebook a{background-position:-19px 0}
ul#social-ikonzs li.twitter a{background-position:-116px 0}
ul#social-ikonzs li.google a{background-position:-39px 0}
ul#social-ikonzs li.stumbleupon a{background-position:-97px 0}
ul#social-ikonzs li.digg a{background-position:0 0}
ul#social-ikonzs li.delicious a{background-position:-136px 0}
ul#social-ikonzs li.linkedin a{background-position:-58px 0}
ul#social-ikonzs li.reddit a{background-position:-78px 0}
ul#social-ikonzs li.technorati a{background-position:-155px 0}
#social-ikonzs strong{display:block;width:auto;padding:5px 8px;position:absolute;background-color:#0974BB;color:white;left:200%;bottom:40px;-webkit-transition:all 0.3s ease 0s;-o-transition:all 0.3s ease 0s;transition:all 0.3s ease 0s;-moz-transition:all 0.3s ease 0s;-khtml-opacity:0;-moz-opacity:0;opacity:0;visibility:hidden}
#social-ikonzs li:hover strong{left:20%;-khtml-opacity:1;-moz-opacity:1;opacity:1;visibility:visible}
.ikonz-social{height:40px;margin-bottom:20px;padding:10px;margin-right:15px;border-radius:2px;-moz-border-radius:2px;-webkit-border-radius:2px;-moz-box-shadow:0 1px 1px rgba(0,0,0,0.31);-webkit-box-shadow:0 1px 1px rgba(0,0,0,0.31);-o-box-shadow:0 1px 1px rgba(0,0,0,0.31);box-shadow:0 1px 1px rgba(0,0,0,0.31);border:1px solid #EEE;background-color:white}
.ikonz-social span{float:left;font-size:150%;padding:0;color:#0974BB}
ul#social-ikonzs{float:left}

What this code does is position and style all of the UL attributes that we are gonna use for sharing links. Positioning image for making them look different from each other since only one image is used and styling them so they become more interactive. You have to place this CSS code after in the <head> section of your theme between <style type="text/css"> and </style>. Now here come the HTML codes:

<ul class='social-ikonz' id='social-ikonzs'>
<li class='facebook'>
<a href='http://www.facebook.com/sharer.php?u={Permalink}' onclick='window.open(this.href,&quot;sharer&quot;,&quot;toolbar=0,status=0,width=626,height=436&quot;); return false;' rel='nofollow' title='Share this on Facebook'><strong>Facebook</strong></a>
</li>
<li class='twitter'>
<a href='http://twitter.com/share?text={block:PostSummary}{PostSummary}{/block:PostSummary}&url={Permalink}' rel='nofollow' title='Tweet This!'><strong>Twitter</strong></a>
</li>
<li class='google'>
<a href='https://plus.google.com/share?url={Permalink}' onclick='javascript:window.open(this.href, &quot;&quot;, &quot;menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600&quot;);return false;' rel='nofollow' title='Share this on Google+'><strong>Google+</strong></a>
</li>
<li class='stumbleupon'>
<a href='http://www.stumbleupon.com/submit?url={Permalink}&amp;title={block:PostSummary}{PostSummary}{/block:PostSummary}' rel='nofollow' title='Stumble upon something good? Share it on StumbleUpon'><strong>StumbleUpon</strong></a>
</li>
<li class='digg'>
<a href='http://digg.com/submit?phase=2&amp;url={Permalink}&amp;title={block:PostSummary}{PostSummary}{/block:PostSummary}' rel='nofollow' title='Digg this!'><strong>Digg</strong></a>
</li>
<li class='delicious'>
<a href='http://delicious.com/post?url={Permalink}&amp;title={block:PostSummary}{PostSummary}{/block:PostSummary}' rel='nofollow' title='Share this on del.icio.us'><strong>Delicious</strong></a>
</li>
<li class='linkedin'>
<a href='http://www.linkedin.com/shareArticle?mini=true&amp;url={Permalink}&amp;title={block:PostSummary}{PostSummary}{/block:PostSummary}' rel='nofollow' title='Share this on LinkedIn'><strong>LinkedIn</strong></a>
</li>
<li class='reddit'>
<a href='http://reddit.com/submit?url={Permalink}&amp;title={block:PostSummary}{PostSummary}{/block:PostSummary}' rel='nofollow' title='Share this on Reddit'><strong>Reddit</strong></a>
</li>
<li class='technorati'>
<a href='http://technorati.com/faves?add={Permalink}' rel='nofollow' title='Share this on Technorati'><strong>Technorati</strong></a>
</li>
</ul>

Now what you need to understand in this code are the Tumblr codes. {Permalink} is the link of your blog post to be shared on viewer's networks or bookmarking websites. {block:PostSummary}{PostSummary}{/block:PostSummary} is the summary of your blog post you can simply replace them with {Title} if you're posting text blogs, I used that because my blog is all about images. You can pretty much understand what's happening in the above HTML code, take a look at all the links all the u or url properties in above codes have the value of {Permalink} because these properties require the url of your blog post, and all the title and text properties require the summary or title of your blog post therefore I used {block:PostSummary}{PostSummary}{/block:PostSummary} as I mentioned above you can also use {Title} for these properties if you're posting text blogs. As always, you have to place this HTML code between {block:Posts}, {block:PermalinkPage} and {/block:Posts} and {/block:PermalinkPage}. So that's enough for this article and all the social sharing articles, I'm gonna mess around with themes and come back with something good to share. You can check out a live demo at my demo blog here. Thanks.

CSS Code:
ul#social-ikonzs,ul#social-ikonzs li{list-style:none;padding:0;margin:0}
ul#social-ikonzs li{float:left;position:relative}
#social-ikonzs a{width:19px;height:20px;display:block;margin:0 3px;background-image:url(http://3.bp.blogspot.com/-GnsWJY-Hblo/UIbck16A3BI/AAAAAAAAGJM/qdog-XGwwQE/h20/sprite+images.png);background-position:0 0;background-repeat:no-repeat}
ul#social-ikonzs li.facebook a{background-position:-19px 0}
ul#social-ikonzs li.twitter a{background-position:-116px 0}
ul#social-ikonzs li.google a{background-position:-39px 0}
ul#social-ikonzs li.stumbleupon a{background-position:-97px 0}
ul#social-ikonzs li.digg a{background-position:0 0}
ul#social-ikonzs li.delicious a{background-position:-136px 0}
ul#social-ikonzs li.linkedin a{background-position:-58px 0}
ul#social-ikonzs li.reddit a{background-position:-78px 0}
ul#social-ikonzs li.technorati a{background-position:-155px 0}
#social-ikonzs strong{display:block;width:auto;padding:5px 8px;position:absolute;background-color:#0974BB;color:white;left:200%;bottom:40px;-webkit-transition:all 0.3s ease 0s;-o-transition:all 0.3s ease 0s;transition:all 0.3s ease 0s;-moz-transition:all 0.3s ease 0s;-khtml-opacity:0;-moz-opacity:0;opacity:0;visibility:hidden}
#social-ikonzs li:hover strong{left:20%;-khtml-opacity:1;-moz-opacity:1;opacity:1;visibility:visible}
.ikonz-social{height:40px;margin-bottom:20px;padding:10px;margin-right:15px;border-radius:2px;-moz-border-radius:2px;-webkit-border-radius:2px;-moz-box-shadow:0 1px 1px rgba(0,0,0,0.31);-webkit-box-shadow:0 1px 1px rgba(0,0,0,0.31);-o-box-shadow:0 1px 1px rgba(0,0,0,0.31);box-shadow:0 1px 1px rgba(0,0,0,0.31);border:1px solid #EEE;background-color:white}
.ikonz-social span{float:left;font-size:150%;padding:0;color:#0974BB}
ul#social-ikonzs{float:left}

HTML Code:
<ul class='social-ikonz' id='social-ikonzs'>
<li class='facebook'>
<a href='http://www.facebook.com/sharer.php?u={Permalink}' onclick='window.open(this.href,&quot;sharer&quot;,&quot;toolbar=0,status=0,width=626,height=436&quot;); return false;' rel='nofollow' title='Share this on Facebook'><strong>Facebook</strong></a>
</li>
<li class='twitter'>
<a href='http://twitter.com/share?text={block:PostSummary}{PostSummary}{/block:PostSummary}&url={Permalink}' rel='nofollow' title='Tweet This!'><strong>Twitter</strong></a>
</li>
<li class='google'>
<a href='https://plus.google.com/share?url={Permalink}' onclick='javascript:window.open(this.href, &quot;&quot;, &quot;menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600&quot;);return false;' rel='nofollow' title='Share this on Google+'><strong>Google+</strong></a>
</li>
<li class='stumbleupon'>
<a href='http://www.stumbleupon.com/submit?url={Permalink}&amp;title={block:PostSummary}{PostSummary}{/block:PostSummary}' rel='nofollow' title='Stumble upon something good? Share it on StumbleUpon'><strong>StumbleUpon</strong></a>
</li>
<li class='digg'>
<a href='http://digg.com/submit?phase=2&amp;url={Permalink}&amp;title={block:PostSummary}{PostSummary}{/block:PostSummary}' rel='nofollow' title='Digg this!'><strong>Digg</strong></a>
</li>
<li class='delicious'>
<a href='http://delicious.com/post?url={Permalink}&amp;title={block:PostSummary}{PostSummary}{/block:PostSummary}' rel='nofollow' title='Share this on del.icio.us'><strong>Delicious</strong></a>
</li>
<li class='linkedin'>
<a href='http://www.linkedin.com/shareArticle?mini=true&amp;url={Permalink}&amp;title={block:PostSummary}{PostSummary}{/block:PostSummary}' rel='nofollow' title='Share this on LinkedIn'><strong>LinkedIn</strong></a>
</li>
<li class='reddit'>
<a href='http://reddit.com/submit?url={Permalink}&amp;title={block:PostSummary}{PostSummary}{/block:PostSummary}' rel='nofollow' title='Share this on Reddit'><strong>Reddit</strong></a>
</li>
<li class='technorati'>
<a href='http://technorati.com/faves?add={Permalink}' rel='nofollow' title='Share this on Technorati'><strong>Technorati</strong></a>
</li>
</ul>

Comments

    0 of 8192 characters used
    Post Comment

    No comments yet.

    Click to Rate This Article