- This topic has 5 replies, 2 voices, and was last updated 8 years, 2 months ago by Tom.
-
AuthorPosts
-
February 19, 2016 at 11:16 am #173884Jen Carlstrom
I’m trying to put a header image on my blog. The url is correct, the image is uploaded, but the image is not displaying on the blog (I see a broken-image box where the image should be)
The code that’s causing the image not to display is:
<img width="1400" height="560" src="https://emily.blogs-dev.wesleyan.edu/files/2016/02/image-1.jpg" class="attachment-full size-full" alt="image-1" srcset="http://emily.blogs-dev.wesleyan.edu/files/2016/02/image-1-300x120.jpg 300w, http://emily.blogs-dev.wesleyan.edu/files/2016/02/image-1-768x307.jpg 768w, http://emily.blogs-dev.wesleyan.edu/files/2016/02/image-1-1024x410.jpg 1024w, http://emily.blogs-dev.wesleyan.edu/files/2016/02/image-1.jpg 1400w" sizes="(max-width: 1400px) 100vw, 1400px" />
It’s the “srcset” part of things that’s causing the image not to display. I know, that “srcset” thing is probably there for the sake of responsive images, and it’s probably looking for files that don’t exist, such as “http://emily.blogs-dev.wesleyan.edu/files/2016/02/image-1-768×307.jpg”
Trouble is, what if I don’t want to create and upload these images? Can we just override this, or can we cut the number of images that “srcset” uses? Really, I’d just like “https://emily.blogs-dev.wesleyan.edu/files/2016/02/image-1.jpg” to display on the page at all resolutions.
Is there some documentation I’m missing or some other obvious thing that I’ve overlooked?
February 19, 2016 at 9:32 pm #173948TomLead DeveloperLead DeveloperWordPress should create those images as the srcset functionality is core behavior.
This plugin will remove that functionality from WP: https://wordpress.org/plugins/disable-responsive-images/
February 22, 2016 at 6:21 am #174361Jen CarlstromThe images exist, but everything following “srcset” breaks the image.
When I remove srcset = “”, my image displays fine. Is there an issue with how your code is handling the responsive images?
What steps do GeneratePress users ordinarily take to succeed in getting that header image to display as something more than a broken image? If there’s documentation available on this, I’m not succeeding in finding it – please help in pointing me in the right direction.
- This reply was modified 8 years, 2 months ago by Jen Carlstrom.
- This reply was modified 8 years, 2 months ago by Jen Carlstrom.
- This reply was modified 8 years, 2 months ago by Jen Carlstrom.
- This reply was modified 8 years, 2 months ago by Jen Carlstrom.
February 22, 2016 at 11:04 am #174445TomLead DeveloperLead DeveloperHi there,
GP doesn’t do anything special to handle responsive images – it allows WordPress to take full control and do what it needs to do.
For most people the WordPress functionality works, but for some it seems to break things. It’s new in WordPress 4.4 so I’m assuming these bugs will be fixed.
If you Google “WordPress srcset broken” you’ll see some discussions on it.
February 26, 2016 at 12:20 pm #175532Jen Carlstromthank you!
February 26, 2016 at 12:23 pm #175535TomLead DeveloperLead DeveloperNo problem 🙂
-
AuthorPosts
- You must be logged in to reply to this topic.