Function Reference/get theme data
This function has been deprecated. That means it has been replaced by a new function or is no longer supported, and may be removed from future versions. All code that uses this function should be converted to use its replacement if one exists. See also
Returns an array of information about a theme file.
This function has been replaced with wp_get_theme in WordPress 3.4
<?php get_theme_data( $theme_filename ); ?>
Use wp_get_theme instead.
- (string) (required) Path and filename of the theme's style.css.
- Default: None
- The function returns an array containing the following keyed information:
- (string) The Themes name.
- (string) Either the Theme's name or a HTML fragment containg the Theme's name linked to the Theme's URI if the Theme's URI is defined.
- (string) The Themes URI.
- (string) A HTML fragment containg the Themes description after it has passed through wptexturize.
- (string) The Theme's Author URI.
- (string) The name of the parent Theme if one exists.
- (string) The Theme's version number.
- (string) the Theme's Status (defaults to 'publish')
- (string) the Theme's Tags
- (string) Either the Author's name or a HTML fragment containing the Author's name linked to the Author's URI if the Author's URI is defined.
Get the information from the theme's style.css and display the Theme Name and Author.
* Assign theme folder name that you want to get information.
* make sure theme exist in wp-content/themes/ folder.
$theme_name = 'twentyeleven';
* Do not use get_stylesheet_uri() as $theme_filename,
* it will result in PHP fopen error if allow_url_fopen is set to Off in php.ini,
* which is what most shared hosting does. You can use get_stylesheet_directory()
* or get_template_directory() though, because they return local paths.
$theme_data = get_theme_data( get_theme_root() . '/' . $theme_name . '/style.css' );
get_theme_data() is located in