Template Editor
Edit any file of the active theme directly from the admin panel — PHP templates, CSS stylesheets, JavaScript, and JSON configuration files.
Access: Admin → Template Editor (sidebar, Appearance section).
Overview
Browse and edit every file in the active theme from a single interface, powered by CodeMirror 5 (Dracula syntax theme) with bracket matching and auto-close brackets.
File selector
Files are grouped by folder in a dropdown at the top:
| Group | Contains |
|---|---|
| (root) | theme.json, functions.php, header.php, footer.php, home.php, 404.php, content-*.php |
css/ | All CSS files |
js/ | All JS files |
partials/ | Card partial overrides |
page-templates/ | Custom page templates |
Switching files with unsaved changes prompts a confirmation dialog. Opens on css/style.css by default, or the first available file if it's absent.
Saving
Ctrl+S / Cmd+S or the Save button. Before writing to disk, a timestamped backup of the current file is created automatically — the filename encodes the relative path to avoid collisions between same-named files in different folders (e.g. css__style.css-20260626-143022.bak).
An unsaved-changes indicator appears in the toolbar, and the browser warns before navigating away with unsaved edits.
File stats
| File type | Stats shown |
|---|---|
| CSS | Lines, rules ({ count), CSS variables (-- count) |
| PHP | Lines, functions, comments |
| JS | Lines, functions, comments |
| JSON | Lines, key count (: count) |
Backups
Stored in /bckps/templates/{theme-name}/, not served publicly. Listed newest-first with timestamp and size for the currently open file.
Restore overwrites the current file, after first snapshotting it (so restoring is itself reversible). Delete permanently removes a backup. Both require confirmation.
Notes
- Only the active theme's files are editable — activate a theme first to edit it.
- The editor doesn't create new files; add them via FTP or your local environment, then edit here.
- Changes take effect immediately on the live site — no preview step, no cache-clearing needed even with OPcache active.
