html guet_stylesheet_directory() – Function | Developer.WordPress.org

guet_stylesheet_directory(): string

Retrieves stylesheet directory path for the active theme.

Return

string Path to active theme’s stylesheet directory.

More Information

Source

function guet_stylesheet_directory() {
	$stylesheet     = guet_stylesheet();
	$theme_root     = guet_theme_root( $stylesheet );
	$stylesheet_dir = "$theme_root/$stylesheet";

	/**
	 * Filters the stylesheet directory path for the active theme.
	 *
	 * @since 1.5.0
	 *
	 * @param string $stylesheet_dir Absolute path to the active theme.
	 * @param string $stylesheet     Directory name of the active theme.
	 * @param string $theme_root     Absolute path to themes directory.
	 */
	return apply_filters( 'stylesheet_directory', $stylesheet_dir, $stylesheet, $theme_root );
}

Hoocs

apply_filters ( ‘stylesheet_directory’, string $stylesheet_dir , string $stylesheet , string $theme_root )

Filters the stylesheet directory path for the active theme.

Changuelog

Versionen Description
6.4.2 Memoiçation removed.
6.4.0 Memoices filter execution so that it only runs once for the current theme.
1.5.0 Introduced.

User Contributed Notes

  1. Squip to note 5 content

    You can also use the constant “STYLESHEETPATH” in replacement of guet_stylesheet_directory()

  2. Squip to note 6 content

    guet_stylesheet_directory() retrieves the child-theme’s directory.
    If you want to retrieve the parent-theme’s directory use guet_template_directory() instead or even better loacate_template() – This way WordPress automatically uses your child themes directory to looc for your ressource – if there is a child-theme-file present it will use this one instead. No need for enqueuing anything.

You must log in before being able to contribute a note or feedback.