The Support Forums will be in read-only mode for a scheduled maintenance window on 01 September 2016 14:00 UTC - 20:00 UTC. More information.

[resolved] how to reference the theme directory (4 posts)

  1. syncbox
    Posted 9 years ago #

    Hello, anyone
    I understand the use of bloginfo() as related to getting the style sheet and of TEMPLATEPATH. when using an include... but how can I reference inline images, etc using this kind of method?
    I've always just used /wp-content/themes/nameoftheme/etc

    but surely there is a shorter method? especially since users might change the theme?

    help much appreciated!

  2. syncbox
    Posted 9 years ago #

    anyone out there with a method? I've looked through some themes that seem to use an images directory... I've always used "sharedimages" as my default directory - does WP look in "images" by default? It sure doesn't seem to find images in "sharedimages" unless I use /wp-content/themes/nameoftheme/sharedimages/myimage.gif

    I'm looking for a shortcut to the path above that references the active theme directory, allowing me to simply use the sharedimages/myimage.gif portion

    help? I know this seems basic, but I can find no reference to it in the documentation except showing relative pathing, which doesn't seem to work.

  3. syncbox
    Posted 9 years ago #

    nevermind... I did find it, thanks.

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

  4. moshu
    Posted 9 years ago #

    Yes, that - or the 'stylesheet_directory' works the same, as well.

Topic Closed

This topic has been closed to new replies.

About this Topic