CLAUDE.md 3.9 KB

CLAUDE.md

Guidance for Claude Code when working in this repository.

What this is

daw — the custom WordPress theme behind davidawindham.com, running since 2004. This git repo covers the theme only (wp-content/themes/daw), not the full WordPress install. It is a classic (non-block) PHP theme with a hand-rolled gulp build. Expect cruft: ~22 years of accumulated pages, libraries, and dead code. Confirm before deleting anything you didn't write — old code here is often load-bearing in non-obvious ways.

Environment

  • Local URL: https://daw.ovid (Apache via Homebrew, self-signed cert)
  • WP install root: /Users/david/Sites/daw (theme is wp-content/themes/daw)
  • PHP: 8.3 · Node: 22 · WP-CLI: 2.12 (wp on PATH)
  • Plugins in play: Gravity Forms (+ Stripe/Signature/PDF), Akismet, WP Super Cache, WP Sweep, dw-guten (custom Gutenberg sidebar/metaboxes)

Build (@wordpress/scripts + webpack — gulp is gone)

Run from the theme directory:

Command What it does
npm run build One-shot production build (config: webpack.config.js)
npm start Watch + BrowserSync proxy of https://daw.stu (port 81)

Webpack compiles everything from npm packages + the bespoke source in src/:

Entry (src/) Output Was (gulp)
legacy-style.js v4-style.min.css copy+mixin+build
front.js js/v4-front.min.js jsf
main.js js/v4-script.min.js copy+js
index.js build/index.js (seed; block scripts)

Edit sourcesrc/*.js, css/*.scss/*.css, style.css, js/front-page.js, and the per-page scripts (js/about.js, js/studio.js, … loaded raw, not bundled), then npm run build. Vendor JS comes from npm (npm update-able); the two libs with no clean package (DrawFillSVG, Rainbow) live in src/vendor/. Never hand-edit the generated v4-*.min.* files — they're clobbered on the next build.

Layout

  • Templates: standard WP hierarchy at theme root (front-page.php, single.php, archive.php, page-{slug}.php, etc.). Many page-*.php map to specific pages by slug (about, studio, music, art, contact, desk…).
  • inc/: theme PHP loaded from functions.phputils.php, template.php, tweaks.php (always), plus smtp.php, form.php, analytics.php loaded conditionally. inc/lib/ holds vendored helpers (Twilio call/SMS, simple_html_dom).
  • header-*.php / footer-*.php: page-specific variants (-home, -studio).
  • Asset loading is centralized in dw_scripts() in functions.php — a big per-page if/elseif ladder keyed on is_page('slug'). Add new page assets there.

Conventions

  • Function/handle prefix is dw_. Match it.
  • .editorconfig is the standard: 2-space indent, LF, UTF-8, final newline, trim trailing whitespace. (Older files have mixed tabs — follow editorconfig for new/edited code.)
  • jQuery is deregistered globally and re-enqueued only where needed; don't assume it's present.
  • Analytics is self-hosted Matomo (/wik/), injected in wp_footer.

Working notes

Scratch space, plans, and investigation notes live in _claude/ — see _claude/README.md. Keep generated artifacts and throwaway scripts there, not at the theme root.

Gotchas

  • style.css is both the WP theme manifest (header comment) and real CSS — don't strip the header.
  • img/ and inc/lib/call/auth.php are gitignored (secrets/assets).
  • Two minified stylesheets exist (style.min.css, v4-style.min.css); the theme enqueues v4-style.min.css. style.min.css is legacy.