Logo Image not Displaying
-
I have a weird issue and I’m not sure it’s actually a WordPress issue but I’m hoping someone can at least shed some light on what’s happening.
I am running MAMP on a Windows 10 box. I am developing a custom theme for my church’s WordPress site and have a logo I need to display at the top. The weird part is the logo is not displaying, but I’m also not getting a broken image icon either. If I inspect the element where the logo should be I can see the box it should be contained in is present but has a height of only 1 pixel. Furthermore, I can see the path being generated by WordPress for the logo image is correct and if I follow it from the Chrome Dev tools I can get it to open in a new tab. When I open the “Sources” tab in Dev Tools I don’t even see the logo showing up there.
I’ve checked the file attributes on the logo image and made sure there wasn’t something weird happening there. All of the other images in the theme are displaying with no problem.
Here’s the code I’m using to display the image:
echo '<div class="col-xs-1" <img class="img-responsive" src="' . IMAGES_DIRECTORY . 'logo.png"></div>'IMAGES_DIRECTORY is a constant I defined as such:
define( 'IMAGES_DIRECTORY', get_template_directory_uri() . '/images/' );I’ve tried both
get_template_directory()andget_template_directory_uri()as a test with the same result. Additionally, I’ve tried the theme in Firefox and Edge with the same result so I don’t think it’s a browser issue, but I’m stumped as to where it’s breaking down.
The topic ‘Logo Image not Displaying’ is closed to new replies.