Resolving CSS Conflicts with Gallery Box and Gallery Box Pro Plugins

The Gallery Box () and Gallery Box Pro plugins load style sheets on every admin page when they are active (bad, bad, bad!!) Some of their styles conflict with styles used in the Integral MailChimp plugin and cause the editor to appear off to the side of your screen. To fix this you can add the following snippet to your theme’s functions.php file. It will simply unload those conflicting style sheets when you are on one of the Integral MailChimp admin pages. It will not affect anything else on your site and Gallery Box will continue to function correctly.

/**
* Dequeue conflicting stylesheets on MailChimp Email pages
*/
add_action('admin_enqueue_scripts', 'remove_css_conflict');

function remove_css_conflict($hook){
     global $post;
     if( ( in_array( $hook, array( 'post-new.php',  'post.php' ) ) && isset( $post ) && $post->post_type == 'imc_email_campaign') || $hook == 'toplevel_page_integral_mailchimp/generaladmin.php' ) {
          wp_dequeue_style( 'gallery-bank.css' );
          wp_dequeue_style( 'stylesheet.css' );
     }
}