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 NamesScreen Shots
small_toolboxAddThis Small Toolbox
small_toolbox_with_shareAddThis Small Toolbox with Share
large_toolboxAddThis 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:

'small_toolbox' => array( 'src' => 
'<div class="addthis_toolbox addthis_default_style addthis_" %s >
<a class="addthis_button_preferred_1"></a>
<a class="addthis_button_preferred_2"></a>
<a class="addthis_button_preferred_3"></a>
<a class="addthis_button_preferred_4"></a>
<a class="addthis_button_compact"></div>', 'img' => 'toolbox-small.png', 'name' => 'Small Toolbox', 'above' => 'hidden ', 'below' => '')

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.

<a class="addthis_button_preferred_5"></a>
<a class="addthis_button_preferred_6"></a>
<a class="addthis_button_preferred_7"></a>
<a class="addthis_button_preferred_8"></a>

And the final result will look like this:

'small_toolbox' => array( 'src' =>  '<div class="addthis_toolbox addthis_default_style addthis_" %s >
<a class="addthis_button_preferred_1"></a>
<a class="addthis_button_preferred_2"></a>
<a class="addthis_button_preferred_3"></a>
<a class="addthis_button_preferred_4"></a>
<a class="addthis_button_preferred_5"></a>
<a class="addthis_button_preferred_6"></a>
<a class="addthis_button_preferred_7"></a>
<a class="addthis_button_preferred_8"></a>
<a class="addthis_button_compact"></a></div>',
'img' => 'toolbox-small.png', 'name' => 'Small Toolbox', 'above' => 'hidden ', 'below' => '')