Forums

images won't show on certain pages (8 posts)

  1. fgshepard
    Member
    Posted 2 years ago #

    I've uploaded some images into an image directory (using ftp, not the wp uploader) and am using them in a template (not in a wp post). Other images in this directory display just fine, but these won't appear on the page. I get the broken image symbol instead. The image files are fine: they work on my local installation and also on other web servers. I think this might have something to do with permalinks (the template is for a new category), but I've tried hardcoding the images with absolute URLs and they still don't appear. If I upload the image using the wp uploader and use that URL, the image will show, but I need these in my images folder and not in the media library. Any idea what could be causing this? Also, if I put the image in the root directory, it will appear. But again, I need to keep these in the images folder. Any help appreciated.

  2. esmi
    Theme Diva & Forum Moderator
    Posted 2 years ago #

    Can you post a link to an example page?

  3. fgshepard
    Member
    Posted 2 years ago #

    Yes, of course:
    http://ircpl.org/category/blog/revisiting-religion/

    I've placed 5 images in the middle of the page for testing.
    text-embellishment01.png and revisiting-religion-header.jpg are also present on the page just above, as the type embellishment below the italicized paragraph, and the header above it, respectively. These show up there because I placed copies of them in the uploads folder, as described in my initial post. But they don't work when placed in my images directory. The large rounded rectangular photograph is in the same directory as these other images, and it shows up just fine. I know that the files are OK.

    also, note that the first of my test images in another directory, also called images, inside my theme folder. this also doesn't display. Oddly, this is the same folder as the header image at the top of the page.

    Finally, I should note that I'm using CSS to display these in my real code, but my test code uses img tags. I just wanted to be sure that it's not my CSS. But this is why you won't see other copies of these images in the source code.

    Hope that's not too much info!

    Thanks!

  4. esmi
    Theme Diva & Forum Moderator
    Posted 2 years ago #

    The images aren't being picked up because the .htaccess file (that is part of your custom permalink structure) is re-routing all traffic for the main domain through WordPress. This includes calls to your images sub-folder.

    The only direct workaround that I can think of is to try and catch requests to the images sub-folder and route them away from WordPress. Essentially that would mean amending your .htaccess file and redirecting calls to /images to http://ircpl.org/images before the WordPress ReWritee block. It does seem rather pointless and I'm not 100% sure it would work "as is" but it's the only option I can think of right now.

  5. fgshepard
    Member
    Posted 2 years ago #

    Thanks for your response. The thing that confuses me about this is that some calls to those folders work properly while others don't. What could account for the inconsistency? The unwanted behavior seems to apply only to files that i've added recently.

  6. esmi
    Theme Diva & Forum Moderator
    Posted 2 years ago #

    The unwanted behavior seems to apply only to files that i've added recently.

    Possibly because you're actually seeing cached copies of older images. These may disappear from your browser cache shortly.

  7. fgshepard
    Member
    Posted 2 years ago #

    I hope not. But we've been using WordPress for about 8 months and this behavior just started today. I haven't changed any of the settings, so I can't imagine what would have triggered it. Very puzzling.

  8. fgshepard
    Member
    Posted 2 years ago #

    So this definitely seems to be a permalink issue. I haven't bothered to figure out the details, but all the old links are still working, and dynamic image calls to new images in the old folder still work well. It's only the new pages that have this problem, and they have slightly different permalink structures than most other pages (they use child categories). I've worked around the problem by putting all the necessary images in a new folder within the "uploads" folder. I'll report back when I have time to figure this out.

Topic Closed

This topic has been closed to new replies.

About this Topic