The real workhorses behind wp_get_attachment_image_src
are image_downsize
& image_get_intermediate_size
.
Between the two, they’ll attempt to find the largest image available that fits within the constraints of the required size.
The return value of wp_get_attachment_image_src
will be:
1 2 3 4 5 |
Array( [0] => 'source of image that best fits', [1] => 'width of source image' [2] => 'height of source image', ) |
If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.