get_post_meta image width for lazy load
Looks like you have the image URL saved as a custom field and not the attachment id so first get the attachment id using the URL using Philips awesome function and then use wp_get_attachment_image_src() to get the attachment attributes : $attch_id = pn_get_attachment_id_from_url(get_post_meta($post->ID, ‘img1’, true)); $image_attributes = wp_get_attachment_image_src( $attch_id ); // returns an array //$image_attributes … Read more