wp_get_attachment_image_srcset Loads Local domain URL as src, Not CDN Domain
-
We’ve began using the srcset attribute on a number of the images on our site by utilizing the ‘wp_get_attachment_image_srcset’ function. However, it appears that non of the URLs generated from that function have the domain of the cdn as their URL. Usage of wp_get_attachment_image_src appears to work fine.
Resulting html is the following:
<img
src=”https://cdn.www.ourcompany.com/wp-content/uploads/2019/07/collaboration.jpg” srcset=”https://www.ourcompany.com/wp-content/uploads/2019/07/collaboration.jpg 720w, https://www.ourcompany.com/wp-content/uploads/2019/07/collaboration.jpg-300×200.jpg 300w, https://www.ourcompany.com/wp-content/uploads/2019/07/collaboration.jpg-1-375×250.jpg 375w”>Thanks for any insight
- The topic ‘wp_get_attachment_image_srcset Loads Local domain URL as src, Not CDN Domain’ is closed to new replies.