get_stylesheet_uri(): string
Retrieves stylesheet URI for the active theme.
Contents
Description
The stylesheet file name is ‘style.css’ which is appended to the stylesheet directory URI path.
See get_stylesheet_directory_uri() .
Return
string URI to active theme's stylesheet.
More Information
Returns URL of current theme stylesheet.
Source
File: wp-includes/theme.php
.
View all references
function get_stylesheet_uri() {
$stylesheet_dir_uri = get_stylesheet_directory_uri();
$stylesheet_uri = $stylesheet_dir_uri . '/style.css';
/**
* Filters the URI of the active theme stylesheet.
*
* @since 1.5.0
*
* @param string $stylesheet_uri Stylesheet URI for the active theme/child theme.
* @param string $stylesheet_dir_uri Stylesheet directory URI for the active theme/child theme.
*/
return apply_filters( 'stylesheet_uri', $stylesheet_uri, $stylesheet_dir_uri );
}
Hooks
-
apply_filters( 'stylesheet_uri',
string $stylesheet_uri ,string $stylesheet_dir_uri ) -
Filters the URI of the active theme stylesheet.
Changelog
Version | Description |
---|---|
1.5.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.
To output the URL
Example output
When using a parent theme:
https://example.com/wp-content/themes/parent-theme/style.css
When using a child theme:
https://example.com/wp-content/themes/child-theme/style.css