diff --git a/wp-includes/functions.php b/wp-includes/functions.php index 64c46ac5a..f670d189c 100644 --- a/wp-includes/functions.php +++ b/wp-includes/functions.php @@ -1681,6 +1681,11 @@ function get_stylesheet_uri() { } function get_template() { + $template = get_settings('template'); + if (!file_exists(get_theme_root() . "/$template")) { //works for dirs too + update_option('template', 'default'); + update_option('stylesheet', 'default'); + } return apply_filters('template', get_settings('template')); }