|
@@ -0,0 +1,75 @@
|
|
|
|
|
+# CLAUDE.md
|
|
|
|
|
+
|
|
|
|
|
+Guidance for Claude Code when working in this repository.
|
|
|
|
|
+
|
|
|
|
|
+## What this is
|
|
|
|
|
+
|
|
|
|
|
+`daw` — the custom WordPress theme behind [davidawindham.com](https://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 (gulp 4, task-based — there is no default task)
|
|
|
|
|
+
|
|
|
|
|
+Run from the theme directory:
|
|
|
|
|
+
|
|
|
|
|
+| Command | What it does |
|
|
|
|
|
+|----------------|---------------------------------------------------------------------|
|
|
|
|
|
+| `gulp copy` | Pull vendor assets out of `node_modules` into `js/` and `css/` (`v4-*`) |
|
|
|
|
|
+| `gulp mixin` | Compile `css/**/*.scss` → `.css` |
|
|
|
|
|
+| `gulp build` | Concat + minify the main stylesheet → `v4-style.min.css` |
|
|
|
|
|
+| `gulp cssf` | Minify front-page CSS → `css/v4-front.min.css` |
|
|
|
|
|
+| `gulp js` | Concat + minify main scripts → `js/v4-script.min.js` |
|
|
|
|
|
+| `gulp jsf` | Concat + minify front-page scripts → `js/v4-front.min.js` |
|
|
|
|
|
+| `gulp run` | BrowserSync proxy of https://daw.ovid + watch (scss/css/php/js) |
|
|
|
|
|
+
|
|
|
|
|
+Edit **source** (`style.css`, `css/*.scss`, `css/*.css`, `js/scripts.js`,
|
|
|
|
|
+`js/front-page.js`), then rebuild. Never hand-edit the generated `v4-*.min.*`
|
|
|
|
|
+files — they are 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.php` —
|
|
|
|
|
+ `utils.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.
|