Easy FancyBox Plugin Docs
Disable FancyBox on certain pages
If you are comfortable with creating / editing PHP files, then method 1 is the best way. If not, try method 2.
If you are using a custom theme or a child theme, then open the theme functions.php and add the following code snippet there. Otherwise, create a new file and place that in a (new) directory
/mu-plugins/ inside the
) && [MY_CONDITIONAL] && easyFancyBox::
Replace [MY_CONDITIONAL] with a condition that would apply to the page or pages where you wish to exclude the light box scripts.
is_page('prints') would apply to a page that has slug “prints”, or
is_home() && is_archive() would disable the scripts on your blog page and all archive pages. In reverse (notice the use of “!” meaning “not”),
!is_page('porfolio') would disable Fancybox on all pages except the one with slug “portfolio”…
How to do that depends on the page editor that is used on your site, and how much rights your user has. If you are using the WordPress core block editor, then you can place a HTML block at the bottom of your page/post content where you paste the above code. Other editors may provide similar content elements.
Or you could place the code snippet in an HTML widget and, if you are using Jetpack with the module Widget Visibility turned on, configure that widget to be active only on the parts of the site where you wish to disable the light box.