Skip to content

Instantly share code, notes, and snippets.

@Pamps
Created October 1, 2019 08:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Pamps/92eba568e3927df6ab38163412a64c7f to your computer and use it in GitHub Desktop.
Save Pamps/92eba568e3927df6ab38163412a64c7f to your computer and use it in GitHub Desktop.
How to get a WordPress attachment image URL in the required size
Much is made of the WordPress function wp_get_attachment_image_src() which returns an array of data for an attachment image.
But dealing with the array is not alway welcome.
wp_get_attachment_image_url() is your friend here as it returns the URL of the attachment at the desired size.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment