The MU forums have moved to WordPress.org

Images not showing on Template (4 posts)

  1. mcblogs
    Inactive
    Posted 19 years ago #

    hey,

    i'm in the process of learning how to create templates and i've run into my first snag. i've been able to select my template and apply it to a page but the images (two of them) that are part of the template are not showing. i'm using <img src="/images/mypic.gif" alt="" /> for the image. any help is greatly appreciated! thanks! jason

  2. jaseone
    Inactive
    Posted 19 years ago #

    Define "not showing"? Is the HTML making it to the page but it isn't finding the images? It sounds like a rewrite problem, where is the images directory compared to the web root within the file syste?

  3. techwench
    Inactive
    Posted 19 years ago #

    If you're using the image in your template files, and your images are in the "images" directory in your theme directory, you need to use:

    <img src="<?php bloginfo('template_directory') ?>/images/image.jpg" />

  4. mcblogs
    Inactive
    Posted 19 years ago #

    oh awesome! that worked. thanks. j

About this Topic