Codex tools: Log in
Contents |
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="" title="" width="" height="" />
get_stylesheet_directory_uri() is located in wp-includes/theme.php.