Living plan for migrating the daw theme from a 22-year-old classic PHP theme to a
modern FSE block theme. Update freely as we go. Companion: [[dependencies]].
Bring daw in line with how I build themes now (the srh theme is the reference),
shedding accumulated cruft along the way — without losing the bespoke, hand-crafted
character of the site.
theme.json + templates/ + parts/ + patterns/ + blocks/, Site-Editor driven (like srh).@wordpress/scripts + webpack — replaces the gulp pipeline.front-page.php (centered card, davo-bot, inline critical CSS); a classic PHP front-page coexists fine inside a block theme.srh theme)functions.php → require_once of inc/<module>/loader.php; each subdir's loader requires its peers. Consistent dw_ function prefix.inc/ by concern: e.g. seo/, analytics/, perf/, a11y/, integrations/ — each procedural, hooked to wp_head/wp_footer/wp_enqueue_scripts.theme.json v3: settings (layout contentSize/wideSize, color palette, typography fontFamilies/fontSizes, spacing) + styles (elements). Design tokens live here, not in CSS.templates/ + parts/: block-markup *.html (index/single/archive/page/home/search/404/category); parts for header/footer.patterns/: auto-discovered from /patterns/ via PHP file headers (Title/Slug/Categories/Block Types). Categories registered in functions.php.blocks/: per-block block.json (apiVersion 3) + render.php; autoRegister:true for render-only blocks (WP 7.0+), manual register_block_type + editor script for interactive ones.wp-scripts build/start, custom webpack.config.js for extra entries + BrowserSync, .babelrc with wp.element.createElement pragma.functions.php → modular inc/ — deferred (2026-06-15): it's only ~200 lines and readable enough; not worth chopping yet. The inc/ modularization will happen naturally as the FSE build grows. Map kept below for when we do.Proposed functions.php → inc/ map (deferred — reference) (current responsibilities → modules):
| Current (in functions.php) | New home |
|---|---|
dw_setup() — theme supports, image sizes |
inc/setup.php |
dw_scripts() — the per-page enqueue ladder |
inc/assets.php (the big readability win) |
dw_editor() — editor styles |
inc/assets.php |
dw_analytics() — Matomo footer |
inc/analytics/matomo.php |
dw_login_session() — auth cookie filter |
inc/auth.php |
dw_ask_widget() — davo-bot loader |
inc/integrations/davo-bot.php |
dw_plugs() → smtp |
inc/integrations/smtp.php (wraps existing inc/smtp.php) |
existing inc/{utils,template,tweaks,form,analytics}.php |
keep; fold into loader |
functions.php ends up a thin bootstrap: define constants → require inc/loader.php.
Behavior must be byte-for-byte identical at this stage (pure reorg, no feature change).
@wordpress/scripts + webpack: package.json (build/start scripts + deps), .babelrc, webpack.config.js (browser-sync proxying daw.stu:3030), src/ → build/ seednpm install + npm run build verified (compiles src/ → build/index.js). npm start wired (browser-sync daw.stu:3030), not yet run.src/ as the block templates need it (incremental, through Phases 2–4)Decision (2026-06-15): new toolchain runs alongside the legacy gulp/v4-* build, not replacing it yet — the live theme still enqueues v4-style.min.css / v4-script.min.js, so gulp stays dormant (deps kept) until block templates supersede those assets. Retiring gulp + v4-* moves to Phase 5. New source is isolated in src/ → build/ so it never collides with the 40 legacy files in js/.
theme.json v3: layout, color palette, typography, spacing, element stylesstyle.css/styles.scsstemplates/: index, single, archive, page, home, search, 404, category, tagparts/: header, footer (retire header-*.php / footer-*.php variants)front-page.php bespoke (coexists)page-*.php: → block template, → pattern, → retire (see open questions)patterns/ for reusable sectionsblocks/ for dynamic bits (music/last.fm, desk loop → Query Loop, etc.)style.min.cssinc/ module map above.bio, cv, shop, archive, chat.fullcalendar still rendered anywhere? Is simple_html_dom still used?