Support » Fixing WordPress » What’s the image path for a new theme?

  • A simple noob question. I created a new theme and need to know the path to the image folder of the theme.

    Say my folder for the theme is THEME1, and inside I have folder IMAGES, then I know my path would be

    http://mywebsite.com/blog/wp-content/themes/THEME1/IMAGES/

    but instead of writing all that out, is there a php function where I can just write something like

    <?php get(TEMPLATEPATH . ‘IMAGES/image.gif’) ?>

    (I just made up the code above, don’t know if it works, but I’m looking for something like that).

    I looked around, I know this is very basic, but couldn’t find the answer. Thanks.

Viewing 2 replies - 1 through 2 (of 2 total)
  • I believe

    <?php bloginfo('template_directory'); ?>

    does this.

    Moderator Samuel Wood (Otto)

    (@otto42)

    WordPress.org Admin

    bloginfo('stylesheet_directory'); is the more usual approach. Look at this example from the default theme’s header.php:

    "<?php bloginfo('stylesheet_directory'); ?>/images/kubrickbgwide.jpg"

    The get_stylesheet_directory_uri() function will also return the base URI in question.

    But yes, the “template” is basically the same thing in almost all cases.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘What’s the image path for a new theme?’ is closed to new replies.