• Resolved Thaddeus Briggs

    (@incubus820)


    I am working locally on MAMP and I am having trouble viewing pictures on my page when I use the <img> tag. The image will not display when I load the page and if I try to open the image in a new browser window, I get the following error…

    “Not Found The requested URL /images/XXX.png was not found on this server.”

    The images that I am trying to view are not part of the WP loop and are going to be used as decoration outside of the main content. If I use a <div> tag I can access the picture as a background-image using the same path, but I was under the impression that using a <div> tag without actual content is not semantic.

    As I mentioned above the images are located in my images folder and I can access them with CSS. Is there something I need to change in order to view the images using the <img> tag?

    Thanks for any help you may provide.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Moderator Kathryn Presner

    (@zoonini)

    To output the correct path, images contained within a folder called “images” within your theme folder need to be addressed in your theme files like this:

    <img src="<?php bloginfo('stylesheet_directory');?>/images/filename.jpg" />

    Thread Starter Thaddeus Briggs

    (@incubus820)

    That is what I was missing! Thank you very much for your help!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘404 error for viewing images with img tag’ is closed to new replies.