Support » Plugin: Easy FancyBox » Limit Easy Fancybox to certain images

  • Resolved Trishah


    I’m using a shopping cart that already has it’s own shadowbox effect for images. I want to limit Easy Fancybox to only certain images on the site outside the cart.

    I have tried unchecking “Images & Inline content” then adding the class="fancybox" to certain images but that is not working. I’ve checked in both FireFox v17 and Chrome v20.

    Any ideas how to accomplish this?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author RavanH


    You’ll have to clear the field where the autodetectable file types are defined (.jpg .png etc.) and then autodetection for images will be off. Then, only links that have your set class=’fancybox’ will work.

    Oh… I see now… What I did was uncheck “Enable FancyBox for Images & Inline content” and use the class on the images. But what I should have done was keep that checked and remove the image extensions from the “Images & Inline content: Auto-detect” input field.

    What I did instead was to use functions.php to keep Easy Fancybox from being active in the shopping cart folders that already have a shadowbox on images. This way I don’t have to add the class to every image. Here is that solution if anyone is interested:

    function stop_easy_fancybox() {
    if(preg_match("/\/folder_name_1\//",$_SERVER['REQUEST_URI']) ||
            remove_action('wp_print_styles', 'easy_fancybox_enqueue_styles', 999);
            remove_action('wp_enqueue_scripts', 'easy_fancybox_enqueue_scripts', 999);
            remove_action('wp_head', 'easy_fancybox', 999);
    Plugin Author RavanH


    Thanks for sharing Trishah.

    You can also use a class to prevent fancybox from being attached: class="nofancybox" … handy for those cases where you only occasionally want to disable FancyBox 😉

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Limit Easy Fancybox to certain images’ is closed to new replies.