Skip to content

Instantly share code, notes, and snippets.

@jeremyclark13
Created April 23, 2012 13:36
Show Gist options
  • Save jeremyclark13/2470972 to your computer and use it in GitHub Desktop.
Save jeremyclark13/2470972 to your computer and use it in GitHub Desktop.
New function wp_get_theme for WordPress 3.4
<?php
$theme_data;
if (function_exists('wp_get_theme')){
$theme_data = wp_get_theme('theme-name');
$theme_uri = $theme_data->ThemeURI;
$author_uri = $theme_data->Author_URI;
} else {
$theme_data = (object) get_theme_data(get_template_directory() . '/style.css');
$theme_uri = $theme_data->URI;
$author_uri = $theme_data->AuthorURI;
}
$version = $theme_data->Version;
$name = $theme_data->Name;
$description = $theme_data->Description;
$author = $theme_data->Author;
//If theme is child theme this is the name of the parent theme
$template = $theme_data->Template;
$tags = $theme_data->Tags;
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment