I built a nice slider using a custom post type but as soon as I added the AddThis plugin it messed it up. AddThis plugin was trying to add the buttons to each slide which broke the layout. Here is how I fixed it.

None of the solutions found on stack overflow really worked, I guess AddThis changes the implementation and you have to keep up. for instance: the filter addthis_post_exclude is replaced with addthis_sharing_buttons_enable.

The solution is to hook into the AddThis filter and disable it when not needed by providing a false value to addthis_sharing_buttons_enable.

The following snippet disables it on all occurrences except single pages, which is a nice way to clean it up on sliders. carousels etc. To achieve this put the following code in your themes functions.php.


// Exclude AddThis widgets from anything other than posts
add_filter('addthis_sharing_buttons_enable', 'addthis_post_exclude');
function addthis_post_exclude($display) {
  if ( !is_singular( 'post' ) )
    $display = false;
  return $display;
}

You could refine it further to only exclude it on certain by refining the condition.

I hope this helped, Cheers!