get_template

Retrieve name of the current theme.

Description

(string) get_template(); 

Returns (string)

Template name.


Usage

  1. if ( !function_exists( 'get_template' ) ) { 
  2. require_once ABSPATH . WPINC . '/theme.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = get_template(); 
  7.  

Defined (1)

The function is defined in the following location(s).

/wp-includes/theme.php  
  1. function get_template() { 
  2. /** 
  3. * Filters the name of the current theme. 
  4. * @since 1.5.0 
  5. * @param string $template Current theme's directory name. 
  6. */ 
  7. return apply_filters( 'template', get_option( 'template' ) );