Sujet : jQuery Fancybox condition

Hi,

I used a wordpress theme and inside my js file I've got a fonction "fancybox" wich is used for all my images (cf code bellow).
My problem is that i used a forum on a specific page (template name and used for my forum is "page-wild.php") and I would like to disable only for these page the fancybox fonction (or only for my template page called "page-wild.php"). My support told me to add a condition like "if" in these part of code :

        // Add Fancybox to anchors containing .jpg, .jpeg, .gif, .png
            jQuery('.post-entry a:has(img)').fancybox({
            'transitionIn'    :    'elastic',
            'transitionOut'    :    'elastic',
            'speedIn'        :    400,
            'speedOut'        :    200
        });

Do you know how could i exclude only for my template page "page wild" these fancybox fonction ?

Thanks for your help

Re : jQuery Fancybox condition

Hi,

you can try to enclose this code block in an if/else structure, testing if current url contains page-wild.php (or its equivalent if using url rewriting).

Use window.location.pathname to get the current path url (relative to host) wink