get_stylesheet_uri() WordPress Function

The get_stylesheet_uri() function is used to retrieve the URL of the current theme's stylesheet. This function is useful for adding the stylesheet to the element of a WordPress page.

get_stylesheet_uri() #

Retrieves stylesheet URI for the active theme.


Description

The stylesheet file name is ‘style.css’ which is appended to the stylesheet directory URI path. See get_stylesheet_directory_uri().


Top ↑

Return

(string) URI to active theme's stylesheet.


Top ↑

More Information

Returns URL of current theme stylesheet.


Top ↑

Source

File: wp-includes/theme.php

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 );
}


Top ↑

Changelog

Changelog
VersionDescription
1.5.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.

Show More