Quick fix for the Customizr – OptimizePress conflict

Quick fix for the Customizr – OptimizePress conflict

There’s a reported bug when combining the Customizr theme with the plugin OptimizePress : the OptimizePress editor in admin does not seem to work properly. This was caused by the fancybox script coming with the Customizr (lightbox), in conflict with Optimize Press

Solution  :

There are two ways to fix the issue :
1) Method 1 : in appearance > customizer > images : uncheck “Enable/disable lightbox effect on images”
2) Method 2 : add the following code in your functions.php of the child theme :

 

add_action('wp_print_scripts' , 'desactivate_fancybox_for_page_builder', 100);
function desactivate_fancybox_for_page_builder() {
if ( isset($_GET['page']) && 'optimizepress-page-builder' == $_GET['page'] )
wp_dequeue_script( 'fancyboxjs' );
}