How Do I Find the SRC of an Image in WordPress?

If you’re looking for the source (or src) of an image in WordPress, you can use the WP_IMAGE_URL() function. This function returns the URL of the image file, including the full path and filename.

For example, if you have an image named “image.jpg” in your WordPress media library, the WP_IMAGE_URL() function would return the following:.

http://example.com/wp-content/uploads/image.jpg

If you’re looking for the source of an image that doesn’t reside in your WordPress media library, you can use the WP_CONTENT_URL() function. This function returns the URL of the current page’s content, including the full path and filename. For example, if you have a page titled “My Site” with an image located at the following URL:

http://example.com/my-site/wp-content/uploads/image.jpg

the WP_CONTENT_URL() function would return the following:

http://example.com/my-site.