• Resolved joelongstreet

    (@joelongstreet)


    New to wordpress…

    How do you access images in your images folder. For example, when I’m working in my index.php file within my template, if I use the tag <img src="images/header.jpg />
    I get nothing that shows up. Why is this?

    Thanks,

    Joe

Viewing 2 replies - 1 through 2 (of 2 total)
  • If you just use images/header.jpg, it looks for that file relative to the root WordPress directory.

    A good method to use is this:

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

    It uses the bloginfo function to return the path of the directory of the current theme. That way the image always displays properly, no matter where your WP install is located.

    Thread Starter joelongstreet

    (@joelongstreet)

    Thanks Dragon,

    I’ll definitely use that in the future.

    Joe

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Accessing Local Images’ is closed to new replies.