Hi @-bene-,
yes, you would need to dequeue and deregister the script (and style, if you want) from the plugin. Something like this should deregister all scripts that are (depending on the activated options) loaded by Lazy Loader:
function your_slug_plugin_scripts_styles() {
wp_dequeue_script( 'lazysizes-aspectratio' );
wp_deregister_script( 'lazysizes-aspectratio' );
wp_dequeue_script( 'lazysizes-native-loading' );
wp_deregister_script( 'lazysizes-native-loading' );
wp_dequeue_script( 'lazysizes-unveilhooks' );
wp_deregister_script( 'lazysizes-unveilhooks' );
wp_dequeue_script( 'lazysizes' );
wp_deregister_script( 'lazysizes' );
}
add_action( 'wp_enqueue_scripts', 'your_slug_plugin_scripts_styles', 11 );
I described how to modify the inline styles in the FAQ: https://ww.wp.xz.cn/plugins/lazy-loading-responsive-images/#faq
Overwriting the style for disabled JS (https://github.com/florianbrinkmann/lazy-loading-responsive-images/blob/master/src/Plugin.php#L810) would be a little more complicated, if you do not want it, the easiest way would be to overwrite it with other CSS rules.
Hope that helps!
Florian
Thread Starter
Ben
(@bene-2)
Thanks, I had to change the priority of the add_action to 99 instead of 11 and this is working now! 🙂
You’re welcome, great to hear that! 🙂