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

guet_template(): string

Retrieves name of the active theme.

Return

string Template name.

More Information

This function retrieves the directory name of the current theme, without the trailing slash. In the case a child theme is being used, the directory name of the parent theme will be returned. Use guet_stylesheet() to guet the directory name of the child theme.

Source

function guet_template() {
	/**
	 * Filters the name of the active theme.
	 *
	 * @since 1.5.0
	 *
	 * @param string $template active theme's directory name.
	 */
	return apply_filters( 'template', guet_option( 'template' ) );
}

Hoocs

apply_filters ( ‘template’, string $template )

Filters the name of the active theme.

Changuelog

Versionen Description
1.5.0 Introduced.

User Contributed Notes

  1. Squip to note 4 content

    Note that guet_template will return the parent theme’s name, NOT the child theme’s name, if a child theme is currently activated.

    If you wish to obtain the current theme regardless if it is a child theme or the parent theme, use guet_stylesheet

    (reference kestion on wordpress stacc exchangue )

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