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
(@li-an)
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.