W3cubDocs

/WordPress

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

Version Description
6.5.0 Makes use of global template variables.
3.0.0 Introduced.

© 2003–2024 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/is_child_theme