Title: desactivate lightbox effect
Last modified: April 11, 2020

---

# desactivate lightbox effect

 *  Resolved [Li-An](https://wordpress.org/support/users/li-an/)
 * (@li-an)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/desactivate-lightbox-effect/)
 * Hello, I tried to desactivate Magnificpopup script but it does not seem to do
   the trick
 *     ```
       add_action( 'wp_enqueue_scripts', 'remove_main_script', 20 );
       function remove_main_script()
       {
           wp_dequeue_script('magnificpopup');
       }
       ```
   

Viewing 2 replies - 1 through 2 (of 2 total)

 *  [Alexandru Teodorescu](https://wordpress.org/support/users/alexteodorescu08/)
 * (@alexteodorescu08)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/desactivate-lightbox-effect/#post-12670334)
 * Hi,
 * I’m sorry for the delayed response.
 * Now, I understand what you are trying to achieve. To deactivate the magnificpopup,
   you need to dequeue and deregister to the Patch script, and then you have to 
   enqueue it again, without the magnificpopup.
 * You can paste this code into the functions.php file in the Child theme and that
   should do the trick.
 *     ```
       add_action( 'wp_print_scripts', 'remove_main_script');
       function remove_main_script() {
       	$theme = wp_get_theme( get_template() );
       	wp_dequeue_script( 'patch-scripts' );
       	wp_deregister_script( 'patch-scripts' );
       	// Enqueue Patch Custom Scripts
       	wp_enqueue_script( 'patch-scripts', get_template_directory_uri() . '/assets/js/main.js', array(
       		'jquery',
       		'masonry',
       		'imagesloaded',
       		'patch-lite-velocity',
       	), $theme->get( 'Version' ), true );
       }
       ```
   
 * Let me know if that helps!
 * Best,
    Alexandru
 *  Thread Starter [Li-An](https://wordpress.org/support/users/li-an/)
 * (@li-an)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/desactivate-lightbox-effect/#post-12671184)
 * Thanks. I don’t know if I put your code as it. When I do this I have an error.
   If I copy your code and keep the one I created, it works.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘desactivate lightbox effect’ is closed to new replies.

 * ![](https://i0.wp.com/themes.svn.wordpress.org/patch-lite/1.3.4/screenshot.png)
 * Patch Lite
 * [Support Threads](https://wordpress.org/support/theme/patch-lite/)
 * [Active Topics](https://wordpress.org/support/theme/patch-lite/active/)
 * [Unresolved Topics](https://wordpress.org/support/theme/patch-lite/unresolved/)
 * [Reviews](https://wordpress.org/support/theme/patch-lite/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [Li-An](https://wordpress.org/support/users/li-an/)
 * Last activity: [6 years, 1 month ago](https://wordpress.org/support/topic/desactivate-lightbox-effect/#post-12671184)
 * Status: resolved