Codex

Function Reference/get theme data

Contents

Description

Returns an array of information about a theme file.

Usage

 <?php get_theme_data$theme_filename ); ?> 

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 containing 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'

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'];
?>

Source File

get_theme_data() is located in ???.

Related

See also index of Function Reference and index of Template Tags.
This article is marked as in need of editing. You can help Codex by editing it.