is_child_theme

The timeline below displays how wordpress function is_child_theme has changed across different WordPress versions. If a version is not listed, refer to the next available version below.

WordPress Version: 6.5

/**
 * Whether a child theme is in use.
 *
 * @since 3.0.0
 * @since 6.5.0 Makes use of global template variables.
 *
 * @global string $wp_stylesheet_path Path to current theme's stylesheet directory.
 * @global string $wp_template_path   Path to current theme's template directory.
 *
 * @return bool True if a child theme is in use, false otherwise.
 */
function is_child_theme()
{
    global $wp_stylesheet_path, $wp_template_path;
    return $wp_stylesheet_path !== $wp_template_path;
}

WordPress Version: 6.4

/**
 * Whether a child theme is in use.
 *
 * @since 3.0.0
 *
 * @return bool True if a child theme is in use, false otherwise.
 */
function is_child_theme()
{
    return get_template_directory() !== get_stylesheet_directory();
}

WordPress Version: 5.5

/**
 * Whether a child theme is in use.
 *
 * @since 3.0.0
 *
 * @return bool True if a child theme is in use, false otherwise.
 */
function is_child_theme()
{
    return TEMPLATEPATH !== STYLESHEETPATH;
}

WordPress Version: 5.1

/**
 * Whether a child theme is in use.
 *
 * @since 3.0.0
 *
 * @return bool true if a child theme is in use, false otherwise.
 */
function is_child_theme()
{
    return TEMPLATEPATH !== STYLESHEETPATH;
}

WordPress Version: 3.7

/**
 * Whether a child theme is in use.
 *
 * @since 3.0.0
 *
 * @return bool true if a child theme is in use, false otherwise.
 **/
function is_child_theme()
{
    return TEMPLATEPATH !== STYLESHEETPATH;
}