WordPress at Your Fingertips

get_stylesheet() WP 1.5.0

Retrieve the name of the current theme directory.

This function retrieves the data with get_option('stylesheet').

The advantage of this function is that it passes the data through the stylesheet filter that plugins can use.

1 time — 0.0032818 sec (very slow) | 50000 times — 3.20 sec (fast) | PHP 7.3.20, WP 5.6
Hooks from the function


String. Stylesheet name.




#1 Output the name (folder name) of the current theme

Suppose we are using "twentytwelve" theme, let's output it's folder name:

echo get_stylesheet(); 

// output: twentytwelve


Since 1.5.0 Introduced.

Code of get_stylesheet() WP 5.8.1

function get_stylesheet() {
	 * Filters the name of current stylesheet.
	 * @since 1.5.0
	 * @param string $stylesheet Name of the current stylesheet.
	return apply_filters( 'stylesheet', get_option( 'stylesheet' ) );

Other Theme Functions

vladlu 100vlad.lu
Editors: Kama 101
No comments
    Log In