Tutorial: building a theme renderer, the Twenty Twenty-Five way
This tutorial walks through how the Twenty Twenty-Five renderer was built, in the order it was built, so you can repeat the process for another theme. Every step names the real files in the renderer package, a check that proves the step works, and the result it had on Twenty Twenty-Five.
You need: the Flx Modernize plugin, the Twenty Twenty-Five renderer package, Node.js 22, PHP 8, a GitHub account (the checks run on GitHub Actions), and a disposable WordPress test site. Never measure or experiment on a live site.
| Step | You will | Fidelity after (desktop / phone) |
|---|---|---|
| 1. Measure first | compare native and Flx pages pixel by pixel | baseline 60.6% / 58.3% |
| 2. Connect plugin and renderer | run both, signed, on a throwaway WordPress | — |
| 3. Use the theme's own CSS | inline the theme's global styles and fonts | (part of the baseline) |
| 4. Header and footer | reproduce the theme's template parts | 70.1% / 69.6% after the footer |
| 5. Post lists | reproduce the query loop | 75.4% / 72.5% |
| 6. Special templates | reproduce a fixed template (the 404) | 80.9% / 77.4% |
| 7. Safety checks | prove who gets Flx and what is cached | — |
| 8. Go live | deploy, verify, and keep a one-command rollback | — |
The header (step 4) moved the score only from 75.4% to 76.1%, but it lined up every page below it.
The one idea behind every step
Render the theme's own markup and let the theme's own CSS style it. WordPress already computes the theme's complete stylesheet (global styles), and the plugin hands the renderer a link to it. If the renderer outputs the same block markup the theme uses (wp-block-group, wp-block-navigation, has-global-padding, …), that stylesheet styles it exactly as on a native page. Writing new CSS to imitate the theme is slower and drifts.
How the steps are verified
Each change goes through the same loop: branch → CI run (fidelity score + safety check) → pull request → merge → automatic deploy → live check. The fidelity gate fails the CI run if the score drops, so a step can only move forward.
Published from rickey29/twenty-twenty-five at commit 2541c1d · Flx Modernize 1.0.0 · Flx Render 1.0.0