Created
October 1, 2019 08:01
-
-
Save Pamps/92eba568e3927df6ab38163412a64c7f to your computer and use it in GitHub Desktop.
How to get a WordPress attachment image URL in the required size
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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