Answers for "disable oceanwp lightbox"

1

disable oceanwp lightbox

/**
 * 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' );
Posted by: Guest on July-19-2021

Browse Popular Code Answers by Language