There’s a few functions:
wp_get_attachment_image_url( $attachment_id, $size )
– Gets the URL to specified size of the image.wp_get_attachment_image_src( $attachment_id, $size )
– Gets an array of the image URL, width, and height for the specified size of the image.wp_get_attachment_image( $attachment_id, $size )
– Gets the full HTML for an image, including width, height, alt, sizes and srcset attributes. If you intend on outputting an HTML<img>
tag, use this.