Error log filling with lazyload errors
-
Hi,
My error log is filling up with this error/notice:
Notice: Trying to get property of non-object in /home/globa781/public_html/wp-content/themes/woodmart/inc/modules/lazy-loading.php on line 193
Hi,
Try to add the following PHP code snippet to the child theme functions.php file to fix this
function woodmart_lazy_attributes($attr, $attachment, $size) {
$attr['data-wood-src'] = $attr['src'];
if( isset( $attr['srcset'] ) ) $attr['data-srcset'] = $attr['srcset'];
if ( is_object( $attachment ) ) {
$attr['src'] = woodmart_get_attachment_placeholder( $attachment->ID, $size );
}
$attr['srcset'] = '';
$attr['class'] = $attr['class'] . ' ' . woodmart_lazy_css_class();
return $attr;
}
Regards
The topic ‘Error log filling with lazyload errors’ is closed to new replies.