Title: Template Directory
Last modified: August 19, 2016

---

# Template Directory

 *  Resolved [ckruse](https://wordpress.org/support/users/ckruse/)
 * (@ckruse)
 * [16 years, 10 months ago](https://wordpress.org/support/topic/template-directory/)
 * Is there an alternative to:
 * bloginfo(‘template_directory’);
 * I need the template directory, but I do not want it echoed out. I need it for
   use in a php script. I know I can use:
 * get_option(‘siteurl);
 * and then just append
 * /wp-content/themes/themefolder/
 * But is there an easier method?

Viewing 3 replies - 1 through 3 (of 3 total)

 *  [blogmum](https://wordpress.org/support/users/blogmum/)
 * (@blogmum)
 * [16 years, 10 months ago](https://wordpress.org/support/topic/template-directory/#post-1155967)
 * There’s [get_bloginfo](http://codex.wordpress.org/Function_Reference/get_bloginfo),
   which just returns the info rather than echoing it out.
 *  [Mark / t31os](https://wordpress.org/support/users/t31os_/)
 * (@t31os_)
 * [16 years, 10 months ago](https://wordpress.org/support/topic/template-directory/#post-1155972)
 * In PHP you can also use dirname, to grab the path from the current file..
    `dirname(
   __FILE__);`
 * Just to offer a secondary method in terms of creating paths.
 *  Thread Starter [ckruse](https://wordpress.org/support/users/ckruse/)
 * (@ckruse)
 * [16 years, 10 months ago](https://wordpress.org/support/topic/template-directory/#post-1156012)
 * Thanks a lot!

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Template Directory’ is closed to new replies.

## Tags

 * [php](https://wordpress.org/support/topic-tag/php/)
 * [template](https://wordpress.org/support/topic-tag/template/)

 * 3 replies
 * 3 participants
 * Last reply from: [ckruse](https://wordpress.org/support/users/ckruse/)
 * Last activity: [16 years, 10 months ago](https://wordpress.org/support/topic/template-directory/#post-1156012)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
