get_theme_root [ WordPress Functions ]
get_theme_root ( $stylesheet_or_template = false )
| Parameters: |
|
| Uses: | |
| Returns: |
|
| Defined at: |
|
| Codex |
Similar Functions: get_theme_roots, get_raw_theme_root, get_theme_root_uri, get_theme_mod, get_theme_mods
Retrieve path to themes directory.
Does not have trailing slash.
Source
function get_theme_root( $stylesheet_or_template = false ) {
global $wp_theme_directories;
if ( $stylesheet_or_template && $theme_root = get_raw_theme_root( $stylesheet_or_template ) ) {
// Always prepend WP_CONTENT_DIR unless the root currently registered as a theme directory.
// This gives relative theme roots the benefit of the doubt when things go haywire.
if ( ! in_array( $theme_root, (array) $wp_theme_directories ) )
$theme_root = WP_CONTENT_DIR . $theme_root;
} else {
$theme_root = WP_CONTENT_DIR . '/themes';
}
return apply_filters( 'theme_root', $theme_root );
}Examples [ wp-snippets.com ]
Top Google Search Results
- Function Reference/get theme root « WordPress Codex
Codex. Codex tools: Log in. Function Reference/get theme root ... Change Log. Since: 1.5.0. Source File. get_theme_root() is located in wp-includes/theme.php .
codex.wordpress.org - get_stylesheet_directory and get_theme_root - need ... - WordPress
I attempted using: get_stylesheet_directory and get_theme_root but neither of them are printing their path for some reason once prepend them to my image path.
wordpress.org - get_theme_roots() - WordPress Codex
Description. Retrieves an array of the names of theme directories keyed by the ...
codex.wordpress.org - get_theme_root (WordPress Function) - WPSeek.com
Jun 9, 2013 ... Retrieve path to themes directory. WordPress lookup for get_theme_root, a WordPress Function.
wpseek.com
