Friday, July 17, 2015

Display WordPress theme information with wp_get_theme()

Display WordPress theme information with wp_get_theme()

Adding WP_GET_THEME() function will let you show data from your theme information like file, name, author, description .... easily and quickly.



PHP Code:

$theme_data = wp_get_theme();
echo $theme_data->get( 'Name' ); // Theme name as given in style.css
echo $theme_data->get( 'ThemeURI' ); // Theme url
echo $theme_data->get( 'Description' ); // Theme Description
echo $theme_data->get( 'Author' ); // Author of theme
echo $theme_data->get( 'AuthorURI' );
echo $theme_data->get( 'Version' );
echo $theme_data->get( 'Template' );
echo $theme_data->get( 'Status' );
echo $theme_data->get( 'Tags' );
echo $theme_data->get( 'TextDomain' );
echo $theme_data->get( 'DomainPath' );

Disqus Comments