From 41680ba34bc36e8c31a35f506840c69f812a39f7 Mon Sep 17 00:00:00 2001 From: Ben Dwyer Date: Fri, 23 Oct 2026 16:04:15 +0100 Subject: [PATCH] Twenty Twenty-Five: Render every template inside a shared index template. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Following the approach in Gutenberg PR #85402, `index.html` becomes the theme's shell — the header part, the common `main` wrapper holding a `core/post-content` slot, and the footer part — while the seven other templates carry only what is particular to them. Each one names the template it is rendered inside in the new `templates` section of `theme.json`. Five of the seven compose to a block-for-block identical tree, so they render as they did before. The `404` and `page-no-title` templates adopt the shared `main` wrapper, so they lose their own padding and their zero top margin respectively. This relies on the `templates` section of `theme.json` and the template substitution added by Gutenberg PR #85402, neither of which core has yet. Co-Authored-By: Claude Opus 5 (1M context) --- .../twentytwentyfive/templates/404.html | 10 +----- .../twentytwentyfive/templates/archive.html | 14 ++------ .../twentytwentyfive/templates/home.html | 12 ++----- .../twentytwentyfive/templates/index.html | 3 +- .../templates/page-no-title.html | 10 +----- .../twentytwentyfive/templates/page.html | 20 ++++------- .../twentytwentyfive/templates/search.html | 16 +++------ .../twentytwentyfive/templates/single.html | 35 ++++++++----------- .../themes/twentytwentyfive/theme.json | 30 ++++++++++++++++ 9 files changed, 62 insertions(+), 88 deletions(-) diff --git a/src/wp-content/themes/twentytwentyfive/templates/404.html b/src/wp-content/themes/twentytwentyfive/templates/404.html index 379f83d326475..d7d56dc7d0806 100644 --- a/src/wp-content/themes/twentytwentyfive/templates/404.html +++ b/src/wp-content/themes/twentytwentyfive/templates/404.html @@ -1,9 +1 @@ - - - -
- -
- - - + diff --git a/src/wp-content/themes/twentytwentyfive/templates/archive.html b/src/wp-content/themes/twentytwentyfive/templates/archive.html index 3b0ddbe25d5f4..e59d29ba3af94 100644 --- a/src/wp-content/themes/twentytwentyfive/templates/archive.html +++ b/src/wp-content/themes/twentytwentyfive/templates/archive.html @@ -1,11 +1,3 @@ - - - -
- - - -
- - - + + + diff --git a/src/wp-content/themes/twentytwentyfive/templates/home.html b/src/wp-content/themes/twentytwentyfive/templates/home.html index ae6870ce48c2f..8429bba1d2d1f 100644 --- a/src/wp-content/themes/twentytwentyfive/templates/home.html +++ b/src/wp-content/themes/twentytwentyfive/templates/home.html @@ -1,10 +1,2 @@ - - - -
- - -
- - - + + diff --git a/src/wp-content/themes/twentytwentyfive/templates/index.html b/src/wp-content/themes/twentytwentyfive/templates/index.html index ae6870ce48c2f..317f86f34b464 100644 --- a/src/wp-content/themes/twentytwentyfive/templates/index.html +++ b/src/wp-content/themes/twentytwentyfive/templates/index.html @@ -2,8 +2,7 @@
- - +
diff --git a/src/wp-content/themes/twentytwentyfive/templates/page-no-title.html b/src/wp-content/themes/twentytwentyfive/templates/page-no-title.html index 17e4781f0d9b7..61964ad369c31 100644 --- a/src/wp-content/themes/twentytwentyfive/templates/page-no-title.html +++ b/src/wp-content/themes/twentytwentyfive/templates/page-no-title.html @@ -1,9 +1 @@ - - - -
- -
- - - + diff --git a/src/wp-content/themes/twentytwentyfive/templates/page.html b/src/wp-content/themes/twentytwentyfive/templates/page.html index 4331194a0cac2..8fdc353afd9c2 100644 --- a/src/wp-content/themes/twentytwentyfive/templates/page.html +++ b/src/wp-content/themes/twentytwentyfive/templates/page.html @@ -1,15 +1,7 @@ - - - -
- -
- - - -
- -
+ +
+ + + +
- - diff --git a/src/wp-content/themes/twentytwentyfive/templates/search.html b/src/wp-content/themes/twentytwentyfive/templates/search.html index 3ccff6f35c24b..9feca5bc63c93 100644 --- a/src/wp-content/themes/twentytwentyfive/templates/search.html +++ b/src/wp-content/themes/twentytwentyfive/templates/search.html @@ -1,12 +1,4 @@ - - - -
- - - - -
- - - + + + + diff --git a/src/wp-content/themes/twentytwentyfive/templates/single.html b/src/wp-content/themes/twentytwentyfive/templates/single.html index 90b7fb2fbe138..a4e44822b5c59 100644 --- a/src/wp-content/themes/twentytwentyfive/templates/single.html +++ b/src/wp-content/themes/twentytwentyfive/templates/single.html @@ -1,25 +1,18 @@ - - - -
- -
- - - - - -
- -
- - - - + +
+ + + + + +
+
- -
+ + + + - + diff --git a/src/wp-content/themes/twentytwentyfive/theme.json b/src/wp-content/themes/twentytwentyfive/theme.json index 7daeb0dbd749d..f53c58c4265b0 100644 --- a/src/wp-content/themes/twentytwentyfive/theme.json +++ b/src/wp-content/themes/twentytwentyfive/theme.json @@ -685,6 +685,36 @@ } } }, + "templates": [ + { + "name": "404", + "template": "index" + }, + { + "name": "archive", + "template": "index" + }, + { + "name": "home", + "template": "index" + }, + { + "name": "page", + "template": "index" + }, + { + "name": "page-no-title", + "template": "index" + }, + { + "name": "search", + "template": "index" + }, + { + "name": "single", + "template": "index" + } + ], "templateParts": [ { "area": "header",