WordPress.org

Ready to get started?Download WordPress

Codex

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

Function Reference/get stylesheet directory uri

Contents

Description

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.

Usage

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

Parameters

None.

Return Values

uri (string) 
Stylesheet directory URI.

Examples

Image (HTML)

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

Notes

Change Log

Source File

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

Related

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