get_stylesheet_directory

Retrieve stylesheet directory path for current theme.

Description

(string) get_stylesheet_directory(); 

Returns (string)

Path to current theme directory.


Usage

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

Defined (1)

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

/wp-includes/theme.php  
  1. function get_stylesheet_directory() { 
  2. $stylesheet = get_stylesheet(); 
  3. $theme_root = get_theme_root( $stylesheet ); 
  4. $stylesheet_dir = "$theme_root/$stylesheet"; 
  5.  
  6. /** 
  7. * Filters the stylesheet directory path for current theme. 
  8. * @since 1.5.0 
  9. * @param string $stylesheet_dir Absolute path to the current theme. 
  10. * @param string $stylesheet Directory name of the current theme. 
  11. * @param string $theme_root Absolute path to themes directory. 
  12. */ 
  13. return apply_filters( 'stylesheet_directory', $stylesheet_dir, $stylesheet, $theme_root );