Disabling lazy load for Internet Explorer

Hi ,
I use newpaper-x (with a child theme) with lazy load for content disabled (“newspaper_x_enable_blazy” = false).
So lazy load is only used by widgets to display thumbnails and featured images (not all site images).
I had troubles with Internet Explorer so I wanted to remove the lazy load for IE . I did that by modifying directly the code of class-newspaper-x-lazyload.php. in the “father” theme.
I replaced the original code
if ( $lazy ) {
$browser = $this->check_browser_version();
if ( $browser[‘name’] === ‘Internet Explorer’ ) {

add_filter( ‘wp_calculate_image_sizes’, ‘__return_false’, PHP_INT_MAX );
add_filter( ‘wp_calculate_image_srcset’, ‘__return_false’, PHP_INT_MAX );
remove_filter( ‘the_content’, ‘wp_make_content_images_responsive’ );
}
add_filter( ‘the_content’, array( $this, ‘filter_lazyload_content’ ) );
}
By
$browser = $this->check_browser_version();
if ( $browser[‘name’] === ‘Internet Explorer’ ) {

add_filter( ‘wp_calculate_image_sizes’, ‘__return_false’, PHP_INT_MAX );
add_filter( ‘wp_calculate_image_srcset’, ‘__return_false’, PHP_INT_MAX );
remove_filter( ‘the_content’, ‘wp_make_content_images_responsive’ );
}
if ( $lazy ) {
add_filter( ‘the_content’, array( $this, ‘filter_lazyload_content’ ) );
}

This changes is to disable IE even if $lazy is false … It works fine … But it is a temporary workaround because I will lost the modifications when updating the them
My questions :

  • is is the right way to do that ?
  • why have you restricted the IE check/disable only if $lazy == 1 ?
  • Is my change could be considered as a permanent change in the newspaper-x theme ?

Please let me know
newpaper-x is a wonderful theme, thank you
JP

Hello there,

I hope you are doing well today.

In order to keep the changes to the theme it would be best to implement them into a child theme.

Please try using the following plugin to create the child theme:

Best Regards,
Support

Hello
Understood. thank you
My main question was that the issue can raise also with the parent theme.
We could have rendering issue with IE when lazy load for all content flag is disable. I haven’t understood why you restricted the IE check and disable only if $lazy == 1 in class-newspaper-x-lazyload.php ? This is why I was suggesting a change.
have a wonderful day
best regards
JP