Customizing the AddThis WordPress Plugin

February 28, 2011 | By

AddThis My favorite WordPress plugin for bookmarking/sharing is AddThis. It looks good and provides comprehensive statistics. But unlike Shareaholic’s SexyBookmarks plugin, which allows you to display any number of the available services (bookmarking or sharing sites, e.g. Digg), AddThis plugin only displays 4. So I modified it by adding a few lines of code to make it display more services and thought others might want to do the same.

AddThis Styles

In the WordPress admin area click the Editor link in the Plugins menu to go the plugin editor. And select AddThis Social Bookmarking Widget from the drop down list on the top right corner of the editor’s page. Then click on the file addthis/addthis_social_widget.php under Plugin Files to edit it. Depending on the style you want to modify, copy the name from the table below and search for it using your browser’s Find dialog box:

Style Names Screen Shots
small_toolbox AddThis Small Toolbox
small_toolbox_with_share AddThis Small Toolbox with Share
large_toolbox AddThis 32x32 Icons

As an example I’ll modify the small toolbox to display 8 services instead of the 4. Please ignore the extra line break in the code listings below, they were added to improve readability only. Currently the small_toolbox array looks like this:

Now just add anchor tags before the closing tag of the div in the value of src. Each tag should use a CSS class addthis_button_preferred_ followed by the sequential number of the service. So the following HTML will add 4 more services.

And the final result will look like this:

Filed in: PHP, WordPress | Tags: ,

Comments are closed.