Support » Plugin: Photo Gallery by 10Web - Mobile-Friendly Image Gallery » Conflict with Easy Fancybox plugin?

  • Resolved Jack All

    (@jack-all)


    Using Photo Gallery plugin, when clicking on an image in a gallery, Easy Fancybox pops up and (behind that) also Photo Gallery pops up. But I need Easy Fancybox plugin for popups on almost all single images of my website.

    How do I prevent this double pop-up?

    Kind regards,
    Jack

    • This topic was modified 2 years ago by Jack All.
    • This topic was modified 2 years ago by Jack All.
Viewing 8 replies - 1 through 8 (of 8 total)
  • Jack All

    (@jack-all)

    I’ve found this solution from the Easy Fancybox plugin author. Put the code below at the end of the functions.php of your theme:

    add_action('wp_head','my_conditional_script',0);
    function my_conditional_script() {
        if ( is_page('your-page-name') || is_page('your-page-name-2') ) {
            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);
        }
    }
    • This reply was modified 2 years ago by Jack All.
    RavanH

    (@ravanh)

    Hi Jack, the Easy FancyBox dev here… I normally advise against running two light box scripts on the same site simply because it makes page load times higher than they need to be. It would be best if you can find a way to use one light box script for all cases: galleries and stand-alone images (and other media?) alike.

    Is there an option in Responsive Photo Gallery to disable the integrated light box? If not, then it might be worth it to find a way to use that one for single images too… Hope the dev can give you pointers on that.

    And in that case, you can simply remove Easy FancyBox 🙂

    • This reply was modified 2 years ago by RavanH.
    Jack All

    (@jack-all)

    Hi RavanH,

    Thanks for your support! There’s an option to disable the lightbox in the Responsive Photo Gallery that I tried earlier, but then Easy Fancybox also doesn’t pop-up.
    Maybe the Photo Gallery team has a permanent fix for this.

    In Photo Gallery there seems no option available to enable a lightbox on non-gallery pages. Might be a good idea for the next version 🙂
    There is an option to not load the script on non photo gallery pages, but that is not what I’m looking for.

    Nevertheless I got it working with your code, so I’m happy now 😉

    Kind regards,
    Jack.

    • This reply was modified 2 years ago by Jack All.
    • This reply was modified 2 years ago by Jack All.
    koreff

    (@koreff)

    Hi
    Thanks for sharing the solution of this problem that has been frustrating me too.
    One question from a newbie:
    What does “your-page-name” and “your-page-name-2” translate to in the actual WP-blog?

    Jack All

    (@jack-all)

    Hi koreff,

    That is the part of the url that holds the page (or post) name of your gallery page, also called “slug” or permalink. You can see the name in Edit and Quick Edit modes in WordPress Admin.
    For this page the name would be “conflict-with-fancybox-plugin-2”

    Good luck,
    Jack.

    koreff

    (@koreff)

    Hi Jack All
    Thanks – Works like a charm – but does that mean that I have to add this section for EVERY gallery page, where I want to ‘short circuit’ easyFancybox?
    All of the exceptions could probably be bundled together in the if-clause?

    koreff

    Jack All

    (@jack-all)

    Hi Koreff,
    Yes, I think you’ll have to add every page in the if clause seperated by ||.

    There might also be other ways, but I am not aware of any way to identify a page containing a Responsive Photo Gallery and hook into that. You could ask the support team here.

    Have a look at some of the other tips on the following Easy FancyBox support pages:
    https://wordpress.org/support/topic/disable-fancybox-for-homepage/
    and
    https://wordpress.org/support/topic/only-load-fancy-box-js-code-css-on-one-page/
    Maybe that works for you.

    Regards,
    Jack

    koreff

    (@koreff)

    Hi Jack All
    OK. I use photo gallery once in a while, so I think I will just make a note to remember tweaking PHP-cod,e when these pages come along, and thus solve my problem.

    Thanks again for your help

    Koreff

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Conflict with Easy Fancybox plugin?’ is closed to new replies.