Home Forums WoodMart – Premium Template Error log filling with lazyload errors

This topic contains 3 replies, has 2 voices, and was last updated by Artem Temos Artem Temos 2 months, 1 week ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #113168

    eskamedia
    Customer

    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

    Private Content Hidden
    #113185

    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

    #113522

    eskamedia
    Customer

    Solved, thanks!

    #113528

    Great, you are welcome.

Viewing 4 posts - 1 through 4 (of 4 total)

The topic ‘Error log filling with lazyload errors’ is closed to new replies.