WordPress.org

Ready to get started?Download WordPress

Codex

Function Reference/get stylesheet directory

Contents

Description

Retrieve stylesheet directory Path for the current theme/child theme.

Note: Does not contain a trailing slash.

Returns an absolute server path (eg: /home/user/public_html/wp-content/themes/my_theme), not a URI.

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

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()

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