is_child_theme(): bool

Whether a child theme is in use.

Return

bool True if a child theme is in use, false otherwise.

Source

function is_child_theme() {
	global $wp_stylesheet_path, $wp_template_path;

	return $wp_stylesheet_path !== $wp_template_path;
}

Changelog

VersionDescription
6.5.0Makes use of global template variables.
3.0.0Introduced.

User Contributed Notes

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