Using WordPress ‘get_theme()’ PHP function

The get_theme() WordPress PHP function retrieves theme data.

Usage

$theme_data = get_theme('your-theme-name');

Parameters

  • $theme string: Required theme name to retrieve data for.

More information

See WordPress Developer Resources: get_theme()

Examples

Get theme version

To get the version of your theme:

$theme_data = get_theme('your-theme-name');
echo 'Theme Version: ' . $theme_data['Version'];

Display theme name

To display the name of your theme:

$theme_data = get_theme('your-theme-name');
echo 'Theme Name: ' . $theme_data['Name'];

Get theme author

To get the author of your theme:

$theme_data = get_theme('your-theme-name');
echo 'Theme Author: ' . $theme_data['Author'];

Display theme description

To display the description of your theme:

$theme_data = get_theme('your-theme-name');
echo 'Theme Description: ' . $theme_data['Description'];

Get theme URI

To get the theme URI:

$theme_data = get_theme('your-theme-name');
echo 'Theme URI: ' . $theme_data['ThemeURI'];