How to get the best resolution of image from srcset

Question

How to get the best image resolution from srcset in WordPress post? For example, the image code looks like this:

    <img src="/uploads/2012/12/Multitronics-TC-750-300x175.jpg"
 class="aligncenter size-medium wp-image-3280 lazyloaded"
 alt="Multitronics TC 750"
 srcset="/uploads/2012/12/Multitronics-TC-750-300x175.jpg 300w, /uploads/2012/12/Multitronics-TC-750-513x265.jpg 513w, /uploads/2012/12/Multitronics-TC-750.jpg 1260w"
 sizes="(max-width: 300px) 100vw, 300px">

How to get the maximum image size (like Multitronics-TC-750.jpg 1260w) using the function? For example wp_calculate_image_srcset ()?

0
jajck_xx 2 years 2020-01-08T08:40:23-05:00 0 Answers 75 views 0

Leave an answer

Browse
Browse