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 theme data

Description

Returns an array of information about a theme file.

Usage

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

Example

Usage

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

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

Parameters

$theme_filename
(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.

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