WordPress函数get_current_theme()

描述:

检索当前主题目录

用法:

<?php get_current_theme() ?>

参数:

None

示例:

<?php
    $theme_name = get_current_theme();
    echo $theme_name;
?>

源文件:

/**
 * Retrieve current theme name.
 *
 * @since 1.5.0
 * @deprecated 3.4.0
 * @deprecated Use (string) wp_get_theme()
 * @see wp_get_theme()
 *
 * @return string
 */
function get_current_theme() {
	_deprecated_function( __FUNCTION__, '3.4', 'wp_get_theme()' );

	if ( $theme = get_option( 'current_theme' ) )
		return $theme;

	return wp_get_theme()->get('Name');
}