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

Function Reference/get stylesheet directory uri


Retrieve stylesheet directory URI for the current theme/child theme. Checks for SSL.

Note: Does not contain a trailing slash.

Note that this returns a properly-formed URI; in other words, it will be a web-address (starting with http:// or https:// for SSL). As such, it is most appropriately used for links, referencing additional stylesheets, or probably most commonly, images.

In the event a child theme is being used, this function will return the child's theme directory URI. Use get_template_directory_uri() to avoid being overridden by a child theme.

If you want to include a local file in PHP, use get_stylesheet_directory() instead.


Use the URI <?php get_stylesheet_directory_uri(); ?> Output the URI <?php echo get_stylesheet_directory_uri(); ?>



Return Values

uri (string) 
Stylesheet directory URI.


Image (HTML)

<img src="<?php echo get_stylesheet_directory_uri(); ?>/images/aternus.png" alt="" width="" height="" />


Change Log

Source File

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


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.