WordPress’s media uploader provides several sizes for your images, including thumbnail, medium, and large. The featured image is also available in full size, and you can use this function to specify its exact size. The wp_get_attachment_image_src() function returns an array of dimensions, including the width and height. The first element of this array represents the src attribute.
The attachment image source function returns an array of width and height values, or false if the file is not present. You can specify the src of an image by setting the $size parameter. In addition, you can pass an optional argument, “icon,” which will change the icon for the image. If this parameter is not present, the result is an empty string. However, the value of the icon argument must be provided.