Disable the Lightbox Scripts
This is a Developer Level doc.
If you're unfamiliar with PHP and/or editing files, codes and templates, as well as with resolving possible conflict, please seek help from a professional. Under our Support Policy, we don't provide support for modifications and customization.
Important: The code below will only function with OceanWP version 2.1.1 and lower.
You can easily disable the Lightbox scripts via Theme Panel > Scripts & Styles. If, for some reason, this option doesn't function for you, you can disable Lightbox scripts using the following PHP snippet:
/** * Disable the Lightbox scripts */ function my_enqueue_scripts() { // Unregister JS files wp_deregister_script( 'magnific-popup' ); wp_deregister_script( 'oceanwp-lightbox' ); // Unregister CSS file wp_deregister_style( 'magnific-popup' ); } add_action( 'wp_enqueue_scripts', 'my_enqueue_scripts', 99 ); /** * Add the no-lightbox class in the body tag */ function my_body_classes( $classes ) { $classes[] = 'no-lightbox'; // Return classes return $classes; } add_filter( 'body_class', 'my_body_classes' );
All PHP snippets should be added via a child theme's functions.php file.