WordPress.org

Ready to get started?Download WordPress

Codex

Attention Interested in functions, hooks, classes, or methods? Check out the new WordPress Code Reference!

Function Reference/get template directory

Description

Retrieves the absolute path to the directory of the current theme, without the trailing slash.

In the case a child theme is being used, the absolute path to the parent theme directory will be returned. Use get_stylesheet_directory() to get the absolute path to the child theme directory.

Usage

<?php echo get_template_directory(); ?>

Parameters

This tag has no parameters.

Return Values

(string) 
Absolute path to the directory of the current theme (without the trailing slash).

Examples

Notes

Change Log

Since: 1.5.0

Source File

get_template_directory() is located in wp-includes/theme.php.

Related

Theme paths: get_template(), get_template_directory(), get_template_directory_uri(), get_theme_roots(), get_theme_root(), get_theme_root_uri(), get_stylesheet(), get_stylesheet_uri(), get_stylesheet_directory(), get_stylesheet_directory_uri(), get_bloginfo()

See also index of Function Reference and index of Template Tags.