• I’m trying to create a new page template and want to include an image..

    it works if I use an absolute URL…

    like

    <img src="https://mydomain.com/wp-content/themes/default/images/my.gif" >,

    but if I try

    <? echo '<img src="' . TEMPLATEPATH . '/images/my.gif" />' ?>

    or just

    <img src="/images/my.gif">

    I get no image..

    what am i doing wrong?

Viewing 4 replies - 1 through 4 (of 4 total)
  • you definitely don’t want to use TEMPLATEPATH

    Try this:

    <img src="<?php bloginfo('template_url'); ?>/images/my.gif" />

    Thread Starter hawthorn

    (@hawthorn)

    thanks ;-))

    I would like to have a different image in every page template I create. What code do you add to what file?

    I opened page.php – gave it a new name – e.g. photography.php

    Do I add the above code in the photography.php file?

    Kathi

    Also… I forgot to add. I want to keep all the same formating that I chanaged in the style.css file. I just want the background to change.

    Kathi

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘including images in page template.’ is closed to new replies.