We can render a media control for print the image URL in a custom <img> tag. For the same we can use  wp_get_attachment_image() function to generate the image…