Add Social Links to Your Wordpress Theme Without a Plugin

by Matt on December 15, 2009

One Wordpress plugin that almost everybody uses these days is one that lets you share your post on social bookmarking and social media websites. And with the way social media has exploded lately, they’d be silly not too. While plugins are great, they can also be bloaty slow loading, require updates and just be a bit of a hassle in general. Luckily it’s very easy to add social links to your Wordpress theme without a plugin, just using php and template tags.

So without further ado, here’s the code to add some popular social bookmarking links to your website without the use of a plugin:

Find wherever you’d like to place the code, usually in single.php and page.php right after the content and add in whichever of these you feel:

<a href="http://del.icio.us/post?url=<?php the_permalink() ?>&amp;title=<?php echo urlencode(the_title('','', false)) ?>">del.icio.us</a>
<a href="http://designfloat.com/submit.php?url=<?php the_permalink() ?>&amp;title=<?php echo urlencode(the_title('','', false)) ?>">design float</a>
<a href="http://digg.com/submit?phase=2&amp;url=<?php the_permalink() ?>&amp;title=<?php echo urlencode(the_title('','', false)) ?>">digg</a>
<a href="http://facebook.com/share.php?u=<?php the_permalink() ?>&amp;t=<?php echo urlencode(the_title('','', false)) ?>">facebook</a>
<a href="http://mixx.com/submit?page_url=<?php the_permalink() ?>&amp;title=<?php echo urlencode(the_title('','', false)) ?>">mixx</a>
<a href="http://reddit.com/submit?url=<?php the_permalink() ?>&amp;title=<?php echo urlencode(the_title('','', false)) ?>">reddit</a>
<a href="http://stumbleupon.com/submit?url=<?php the_permalink() ?>&amp;title=<?php echo urlencode(the_title('','', false)) ?>">stumbleupon</a>
<a href="http://technorati.com/faves?add=<?php the_permalink() ?>&amp;title=<?php echo urlencode(the_title('','', false)) ?>">technorati</a>

That’s it. You can do this with any site by looking at their link structure and replacing the url with the permalink and the title with the title echo as you see above.

Spicing the Links Up

An easy way to spice these bookmarking links up is to add icons to them. Just replace the name of the site with

<img src="http://theiconurl"> alt="The Title">

(while replacing the variables) and you’ll be on your way. I also suggest adding

<div class="sociallinks">

before the code and

</div>

afterwards, so you can go to your css and style the links as you see fit.

Now your theme includes some social bookmarking links and you didn’t need a plugin. Isn’t Wordpress great?


Thesis Theme for WordPress:  Options Galore and a Helpful Support Community

Stay Updated:


If you liked this post, you will definitely enjoy our others. Subscribe to the feed via RSS or Email to get instantly updated for those awesome posts soon to come. Also, I'm on Twitter.

  • cdstar1
    im not quite sure i understand, i copy and paste above code but it just shows up like that in my blog.
  • Where are you placing it? It needs to be placed in the theme files (single.php for example.)
  • Cliff
    Is there any possible way do add a LiveJournal social link to a Wordpress theme without a plugin?
  • That one I'm not sure about. If you could show me an example of the link that appears when you click a "Share to Live Journal" link I could give you the code, but I haven't been able to find the structure that Live Journal uses to share links.
  • Thank you for the beautiful tip! I totally agree that, its better to use this code than using a plugin.
  • cheers mate
    better without a plugin
  • well written and easy explanation...will try on my new blog
blog comments powered by Disqus

Previous post: No More Minimum Deposit for Premium Wordpress Themes

Next post: Free Minimal Wordpress Theme: Elegant Blog

  • Theme Thesis
    Find skins and customizations for the great Thesis theme at Theme Thesis.
  • Need Hosting?
    This site is proudly hosted by Host Gator. They provide fast, affordable hosting and great support.