WordPress.org

Codex

Interested in functions, hooks, classes, or methods? Check out the new WordPress Code Reference!

Function Reference/get stylesheet directory

Description

This functions returns the absolute path of the current theme (the stylesheet directory) that contains your stylesheet(s). If you have a child theme, this returns the absolute path of the child theme.

Note:the returning path does not contain a trailing slash.

An example output of get_stylesheet_directory() is /home/user/public_html/wp-content/themes/my_theme

To retrieve the URI of the stylesheet directory use get_stylesheet_directory_uri().

To retrieve the path of a parent theme, use get_template_directory().

Usage

<?php get_stylesheet_directory() ?>

Parameters

None.

Return Values

uri (string) 
Stylesheet directory Absolute Path.

Examples

Include a PHP file

<?php include( get_stylesheet_directory() . '/includes/myfile.php'); ?>

Notes

Change Log

Source File

get_stylesheet_directory() is located in wp-includes/theme.php.

Related

Theme paths: get_template(), get_template_directory(), get_template_directory_uri(), get_theme_roots(), get_theme_root(), get_theme_root_uri(), get_stylesheet(), get_stylesheet_uri(), get_stylesheet_directory(), get_stylesheet_directory_uri(), get_bloginfo(), get_theme_file_uri(), get_theme_file_path()

See also index of Function Reference and index of Template Tags.