• Resolved maks12345

    (@maks12345)


    I created a gallery in it there is a built-in viewer, and when I call an image on the photo and I open the photo 2 times in Preview and then in Easy FancyBox. I need to make photographic work open in view and not open in Easy FancyBox. P. S. Easy FancyBox can not be deleted, it is very necessary.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi Max,

    If you have a custom theme (or child theme) could try adding this to your theme functions.php

    
    add_action('wp_head','my_conditional_script',0);
    
    function my_conditional_script() {
        if ( is_page('portfolio') ) {
            remove_action('wp_enqueue_scripts', array('easyFancyBox', 'enqueue_styles'), 999);
            remove_action('wp_head', array('easyFancyBox', 'main_script'), 999);
            remove_action('wp_print_scripts', array('easyFancyBox', 'register_scripts'), 999);
            remove_action('wp_footer', array('easyFancyBox', 'enqueue_footer_scripts'));
            remove_action('wp_footer', array('easyFancyBox', 'on_ready'), 999);
        }
    }
    

    Change the ‘portfolio’ in is_page('portfolio') to match the slug of your gallery page where you wish to disable FancyBox.

    Thread Starter maks12345

    (@maks12345)

    RavanH, Thank you!

    Would it not be better to have the option, while in the select media, to have a tick – disable or enable – enable would be the default.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How to disable the Easy FancyBox plug-in on a specific page?’ is closed to new replies.