diff --git a/lib/compat/wordpress-5.9/block-template-utils.php b/lib/compat/wordpress-5.9/block-template-utils.php index 690fae6a16a464..4e9d5c7680e575 100644 --- a/lib/compat/wordpress-5.9/block-template-utils.php +++ b/lib/compat/wordpress-5.9/block-template-utils.php @@ -37,7 +37,11 @@ function get_block_theme_folders( $theme_stylesheet = null ) { $root_dir = get_theme_root( $theme_name ); $theme_dir = "$root_dir/$theme_name"; - if ( is_readable( $theme_dir . '/block-templates/index.html' ) ) { + $parent_theme_name = get_template(); + $parent_root_dir = get_theme_root( $parent_theme_name ); + $parent_theme_dir = "$parent_root_dir/$parent_theme_name"; + + if ( is_readable( $theme_dir . '/block-templates/index.html' ) || is_readable( $parent_theme_dir . '/block-templates/index.html' ) ) { return array( 'wp_template' => 'block-templates', 'wp_template_part' => 'block-template-parts',