• Resolved caravelleproject

    (@caravelleproject)


    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.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The problem is that your site is using https but the image is being referenced with http. Most browsers these days don’t load the non-secure mixed active content and block it. Firefox 47 did for me. Screenshot: https://i.imgur.com/ZM1b0T7.png

    Need to try and make all your image references be https that are in your blog’s domain.

    Thread Starter caravelleproject

    (@caravelleproject)

    Yes indeed, that was it. I found the media prefix setting under setting > media and made all images use https. Everything’s displaying normally, now. Thank you for your help MarkRH.

    Thread Starter caravelleproject

    (@caravelleproject)

    Oh, and: resolved.

    i followed this example, but there is no setting in “Media” to make all images use https

    Please elaborate on this more, or offer a different solution.
    We are posting from Hootsuite to our blog on WordPress. The text shows up, but no images. When we go into the back end of the site and add an image to a post, it only shows up when the post is clicked and pops up in a new screen/tab.

    @jj Lukas: Please make your own thread. As this is marked “resolved” few will look at it. When you do, be sure to include a link to post exhibiting the behavior.

    @jj-lukas I have the same issue as you, I did not find another related thread.
    there is no setting in “Media” to make all images use https
    Help appreciated

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Images not displaying in page body’ is closed to new replies.