I rely heavily on the WordPress.org forums for help and solutions to various problems. When I can, I try to give back to the community by answering other peoples questions. Today, I stumbled upon Ben, who had a problem with images not showing up on his website.
The first three things that anyone will tell you to do when debugging a WordPress problem are:
- Switch to the default theme (currently TwentyTwelve, tho TwentyEleven will still do)
- Turn off all plugins
- Re-upload core WordPress files (and delete any old ones that should not longer be there)
So what if you do all that and your problem still isn’t apparent?
In the case of images, one immediately thinks of file paths and file permissions. But in Ben’s case, both of these seemed to be intact as well. We had overwritten his .htaccess file, updated his permalinks, and all file paths looked fine. The images were on the server, I was able to download them and open them on my computer with no fuss. But within the Media Library, and on the website, any uploaded images drew a blank. Oddly, other images that were innate to the the theme showed up fine.
Then I found this thread in the forums, where the infamous esmi clued me in to the idea of hotlinking protection. I’d never heard of it! But it does follow that if WordPress seems to be doing everything it should, then the next culprit in line that must surely be causing problems is your web host.
A little more digging turned up this great article, which allowed me to create a quick work around and get Ben back on his way.
Hopefully this shared knowledge can help someone else avoid unnecessary hair-pulling.