AddThis

  • UserId: 1
  • Title: AddThis
  • Url: addthis
  • Summary: AddThis
  • Search:
  • DateCreated:
  • DateModified:
  • Published: 1
  • Pageable: 1

Today I was tasked with adding several Social Bookmarking sites to a client's website, at work. Whilst reading through the various APIs for each site, I decided to look at AddThis that I had come across over the weekend.

AddThis saved me 2 days (estimated) development time, by combining all of the popular Social Bookmarking sites in one easy-to-integrate solution. I was so impressed that I decided to add AddThis to slickhouse!

AddThis provides a WordPress plugin from the outset, but I often find plugins to be too restrictive. AddThis is also available as a standard button or a dropdown menu, displaying several options. All 3 options use a new window to display the various Social Bookmarking sites.

I decided to opt for the dropdown, but hard-coded into the WordPress theme files. Firstly, to display AddThis on the main pages, open index.php and add the AddThis code. However, as you'll most likely be calling this code several times on the page, you need to define the URL and Title for each instance of AddThis:

addthis_url

= '<?php the_permalink() ?>';

addthis_title = '<?php the_title(); ?>';

Use the above to replace the default Javascript location.href and document.title respectively. This uses WordPress' dynamic variables for each instance of AddThis.

On a single WordPress page (single.php), you can use the default code provided by AddThis easily enough, or use the above alterations - either way will work fine, as you should only be calling AddThis once.

And hey presto - AddThis has been added to WordPress! Feel free to use AddThis to add slickhouse posts to your preferred Social Bookmarking site. Personally, I'm a Digg/Google user.

Categories that this Post has been filed under

  • Articles - Longer posts that warrant an article status
  • Slickhouse - Anything to do with slickhouse.com in particular
  • Web - The Web, XHTML/CSS/ASP/.NET/SQL/PHP etc.
  • Work - Anything work related

Tags that this Post has been tagged with

Comments

A day later and I discovered how to alter AddThis to enable me to use a different button for the dropdown version. Simply copy the Javascript output (from the src= within the AddThis code) and make a local copy instead. The Javascript is messy as one block, but after 15 minutes or so, you should end up with a well laid-out piece of code - from which you can easily alter the source of the bookmark button.

Matt


Hi Thanks for the details. I registered myself and posted the code. The code on the page doesnt show my blog post. any reason what I am missing in the code? Best, MT

Dr. Mohamed Taher


Perhaps try an AddThis plugin for WordPress first, to see if that works? Then look at the above.

Matt


What about using this in Blogspot? Will it work or what is missing in my code?

Dr. Mohamed Taher


Sorry for the delay - it appears that you've got it working with Blogspot? Let me know if not and I'll look at the source code.

Matt


Add a Comment