Ready to get started?Download WordPress


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

Difference between revisions of "Function Reference/get theme data"

(remove new page created)
(Using Parameter template)
Line 22: Line 22:
== Parameters ==
== Parameters ==
; theme_filename : (''string'') Path and filename of theme's style.css.
{{Parameter|$theme_filename|string|Path and filename of the theme's <tt>style.css</tt>.}}
== Return values ==
== Return values ==

Revision as of 02:06, 13 January 2008


Returns an array of information about a theme file.


 <?php $theme_data get_theme_data($theme_filename); ?> 



Get the information from the default themes style.css and display the Name and author linked with there respective URIs if they exist.

    $theme_data = get_theme_data(ABSPATH . 'wp-content/themes/default/style.css');
    echo $theme_data['Title'];
    echo $theme_data['Author'];


(string) (required) Path and filename of the theme's style.css.
Default: None

Return values

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) A HTML fragment containg the Themes description after it has passed through wptexturize.
(string) Either the Author's name or a HTML fragment containg the Author's name linked to the Author's URI if the Author's URI is defined.
(string) The Theme's version number.
(string) The name of the parent Theme if one exists.
(string) defaults to 'publish'
This article is marked as in need of editing. You can help Codex by editing it.