Title: WP_Theme::get_theme_root
Published: April 25, 2014
Last modified: April 28, 2025

---

# WP_Theme::get_theme_root(): string

## In this article

 * [Description](https://developer.wordpress.org/reference/classes/wp_theme/get_theme_root/?output_format=md#description)
 * [Return](https://developer.wordpress.org/reference/classes/wp_theme/get_theme_root/?output_format=md#return)
 * [Source](https://developer.wordpress.org/reference/classes/wp_theme/get_theme_root/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/classes/wp_theme/get_theme_root/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/classes/wp_theme/get_theme_root/?output_format=md#changelog)

[ Back to top](https://developer.wordpress.org/reference/classes/wp_theme/get_theme_root/?output_format=md#wp--skip-link--target)

Returns the absolute path to the directory of the theme root.

## 󠀁[Description](https://developer.wordpress.org/reference/classes/wp_theme/get_theme_root/?output_format=md#description)󠁿

This is typically the absolute path to wp-content/themes.

## 󠀁[Return](https://developer.wordpress.org/reference/classes/wp_theme/get_theme_root/?output_format=md#return)󠁿

 string Theme root.

## 󠀁[Source](https://developer.wordpress.org/reference/classes/wp_theme/get_theme_root/?output_format=md#source)󠁿

    ```php
    public function get_theme_root() {
    	return $this->theme_root;
    }
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-theme.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/6.9.4/src/wp-includes/class-wp-theme.php#L1227)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/6.9.4/src/wp-includes/class-wp-theme.php#L1227-L1229)

## 󠀁[Related](https://developer.wordpress.org/reference/classes/wp_theme/get_theme_root/?output_format=md#related)󠁿

| Used by | Description | 
| [WP_Theme::__get()](https://developer.wordpress.org/reference/classes/wp_theme/__get/)`wp-includes/class-wp-theme.php` |

__get() magic method for properties formerly returned by [current_theme_info()](https://developer.wordpress.org/reference/functions/current_theme_info/)

  | 
| [WP_Theme::offsetGet()](https://developer.wordpress.org/reference/classes/wp_theme/offsetget/)`wp-includes/class-wp-theme.php` |  |

## 󠀁[Changelog](https://developer.wordpress.org/reference/classes/wp_theme/get_theme_root/?output_format=md#changelog)󠁿

| Version | Description | 
| [3.4.0](https://developer.wordpress.org/reference/since/3.4.0/) | Introduced. |

## User Contributed Notes

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fclasses%2Fwp_theme%2Fget_theme_root%2F)
before being able to contribute a note or feedback.