Languages: English • 한국어 • (Add your language)
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(); ?>
None.
Image (HTML)
<img src="<?php echo get_stylesheet_directory_uri(); ?>/images/aternus.png" alt="" width="" height="" />
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()