Blog

AddThis for WordPress 2.0.1 and Customizing Our WordPress Plugin

I just pushed live the 2.0.1 release of our WordPress plugin. In addition to a handful of bug fixes and theme compatibility issues, we’ve added a couple of filters to make it easier for you to customize your plugin. For example, it’s now easy to implement a custom toolbox. All you need to do is include a filter (learn more about how WordPress uses filters) in your theme’s functions.php file or an additonal plugin that you create. The following filters are available:

  • addthis_above_content – For the sharing buttons above the content
  • addthis_below_content – For the sharing buttons below the content
  • addthis_sidebar_style_output – For the widget sharing style

For example if you want to have three preferred services followed by the pillbox style share counter above the content, you can use:

add_filter('addthis_above_content', 'addthis_new_above_content');
function addthis_new_above_content()
{
return '<div class="addthis_toolbox addthis_default_style" %s > <a class="addthis_button_preferred_1"> <a class="addthis_button_preferred_2"> <a class="addthis_button_preferred_3"> <a class="addthis_counter addthis_pill_style"> </div>';
}

One thing to notice with this is the inclusion of %s in the container div. This allows the plugin to set the title and url for the specific post you are viewing.

Here at AddThis we love your feedback. If there are any more bugs you encounter or changes you would like to see, please don’t hesitate to visit our support forums.

  • I trying for modify this code but i not work. I don’t know why. i think i miss take some think.
    i will trying again.

  • @dodo123, can you tell me more about the problem that you’re having?

  • I’ve added the AddThis Plugin to my WordPress site, and so far am very impressed. A great addition to any site. Is there a way to disable the #.TpVxxx that gets added to the end of URLs?