Support

Account

Home Forums General Issues Image URL returns ID and not a string Reply To: Image URL returns ID and not a string

  • To print the image URL instead of ID, replace

    wp_get_attachment_image( $image, $size );

    with

    wp_get_attachment_image_url( $image, $size );

    more info here:
    https://developer.wordpress.org/reference/functions/wp_get_attachment_image_url/