WordPress.org

Ready to get started?Download WordPress

Forums

Images Not Appearing (5 posts)

  1. rgwhitaker
    Member
    Posted 2 years ago #

    I'm developing my own WP theme from scratch so that it matches my website that I've designed.

    I am developing and running WP on my local machine using XAMPP.

    When I view the blog list page, none of the images appear. My theme is located within the xampp/htdocs/wordpress/wp-content/themes/mysite folder. Within that folder there is a /images folder, where all the image files reside.

    Within my WP .php file, I'm simply using a <img src=> statement to call the images, but they don't appear.

    Does anyone have a clue why images do not appear? I've never had this happen before.

    Thank you.

  2. Slobodan Manic
    Member
    Posted 2 years ago #

    rgwhitaker,

    What is the exact path you're using to call the images? Should be dynamic, like this:

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

  3. rgwhitaker
    Member
    Posted 2 years ago #

    Right now I'm just using a straight <img src="images/image.jpg" width="" height=""> tag.

  4. rgwhitaker
    Member
    Posted 2 years ago #

    That worked!!!!!!!!!!!!!

    Thank you so much!!!!!!!!!!!

    Now, my inquisitive mind wants to know: why? Why does this tag work

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

    But not this?

    <img src="images/image.jpg" width="" height="">

  5. esmi
    Forum Moderator
    Posted 2 years ago #

    Relative paths/urls will not work in WordPress. You need to use absolute paths/urls.

Topic Closed

This topic has been closed to new replies.

About this Topic