get_stylesheet

Retrieve name of the current stylesheet.

Description

(string) get_stylesheet(); 

The theme name that the administrator has currently set the front end theme as.

For all intents and purposes, the template name and the stylesheet name are going to be the same for most cases.

Returns (string)

Stylesheet name.


Usage

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

Defined (1)

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

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