Images not displaying in page body
-
Hello. I have a site built with WordPress 4.4.1 and I’m having some trouble with images not displaying when they’re inserted using the add-media button. When I view pages that have been created to display inserted media, I see the alt-text or a broken-link icon instead of the image in the media library. The link generated along with the image leads to the correct file.
This is not the case for images displayed through custom fields or through other functions (the site-header, etc), only for images inserted directly into text using the built-in media browser. I’ve done some trouble-shooting and I understand what in the html is causing the problem, but I don’t understand why or how to fix it.
Some help would be greatly appreciated.
If I insert an image into the page using the ‘add media’ button, it produces this code:
<a href="https://caravelleproject.com/uploads/2016/05/ella_seawoman.jpg" rel="attachment wp-att-239"><img src="https://caravelleproject.com/uploads/2016/05/ella_seawoman-246x300.jpg" alt="Ella Maillart en tenue de marin" width="246" height="300" class="alignright size-medium wp-image-239" /></a>
That will be transformed into the following html on the generated page: (with no image)
<div id="attachment_264" class="wp-caption alignright" style="width: 210px"> <a rel="lightbox[121]" href="https://caravelleproject.com/uploads/2016/05/Book-Ambjorn_barbe_piercing.png" class="lightbox-enabled"> <img width="246" height="300" sizes="(max-width: 246px) 100vw, 246px" srcset="https://caravelleproject.com/uploads/2016/05/ella_seawoman-246x300.jpg 246w, https://caravelleproject.com/uploads/2016/05/ella_seawoman.jpg 393w" class="alignright size-medium wp-image-239" alt="Ella Maillart en tenue de marin" src="https://caravelleproject.com/uploads/2016/05/ella_seawoman-246x300.jpg"> </a> </div>
I’ve tried stripping the srcset attribute and the wp-image-XXX value for the class attribute out of the img tag. If I copy-paste that html back into the page and post it, the image displays normally. The srcset attribute and the wp-image-XXX class seem to be causing the problem.
I can probably work around this, but it’s an awkward fix. I’d prefer to be able to use the WordPress interface normally. Can anyone help me figure out what’s going on and help me fix the images posted into the page content of my site?
As recommended, I tried disabling all plugins and switching to the Twenty Sixteen theme. I’ve taken a look in several browsers on a couple of machines running Mac and Linux. I am not the server admin, so upgrading the installation is not my decision to make.
Here’s a link to a page on the site where the problem appears.
- The topic ‘Images not displaying in page body’ is closed to new replies.