Theme Setup

Enterprise WordPress theme architecture that holds up at year three

Hosting target, build pipeline, editor guardrails, package boundaries, local environment. Five decisions taken in the first week, none visible at launch, all still setting the cost of every change three years later.

Foundation decisions

Five decisions that are cheap now and expensive later

Theme setup is not installing a theme. It is the set of structural calls that decide whether the platform is still maintainable years after launch.

The hosting target decides the theme

WordPress VIP does not permit the same build as Kinsta, Ymir or a Trellis-provisioned DigitalOcean host. On VIP we ship a classic PHP theme with logic split across inc, template-parts and classes. Everywhere else we run the Roots stack: WordPress versioned by Composer, Acorn, Blade. Decide it late and you write the templates twice.

A build pipeline that still runs in three years

Every dependency is declared and locked, so the build is reproducible rather than reconstructed from memory. This site runs Vite and Tailwind CSS v4, PHP floored at 8.3, and WordPress core managed as a Composer package. Upgrading becomes a reviewed diff, not an operation nobody wants to own.

Editorial guardrails compiled into theme.json

Design tokens defined once in CSS compile into the WordPress editor at build time. On this site that yields 96 approved colors and 13 type sizes, with the WordPress default palette, default gradients, default font sizes and every free-text override switched off.

Package boundaries instead of a growing functions.php

Anything that is not presentation lives in its own Composer package, developed in-repo through path repositories and symlinked into vendor. This codebase carries six, from the AI hub to the SEO assistant and the MCP abilities. Each can be versioned, tested and removed without touching a template.

A local environment that mirrors staging

The local setup is provisioned against the hosting target rather than whatever each developer already had installed: Docker, Herd or Trellis, chosen by where the site will actually run. The rule is that what works locally works the same way on staging. A setup that cannot promise that turns every deploy into a test.

Reference implementation

The reference implementation is this website

These are not client results. They describe the codebase behind 40q.agency as of August 2026 and will move as it does. A foundation claim you cannot inspect is worth very little.

48

Block types, each with exactly one PHP handler class and one Blade template. One to one, no exceptions

96 and 13

Approved colors and type sizes generated into the editor from the token file, with WordPress defaults and free-text overrides off

13 and 5

Section background options and vertical padding steps offered to editors. Layout is a menu, not a CSS field

What it buys you

What the foundation is worth once you stop looking at it

The point of this work is not elegance. It is what stays cheap after launch, when nobody is watching the architecture.

Onboarding measured in days

Conventions are written down and then enforced by structure. Block names, template locations and attribute shapes follow one pattern, so a new developer learns one convention and applies it 48 times instead of learning 48 exceptions.

Design changes that stay out of the code

Colors, type scale and spacing live in one token file that compiles into both the frontend and the editor. A rebrand becomes an edit to tokens instead of a hunt for hardcoded hex values across templates.

Upgrades you can actually review

Core, plugins and internal packages are declared in composer.json and pinned by a lockfile. Every upgrade arrives as a diff someone can read and a build someone can run, which keeps a platform patchable long after launch.

What engineering leads ask us before a build starts

The questions that decide whether a foundation is worth paying for.

Related insights

Keep reading on architecture and maintainability

Setup choices, custom themes, and the cost of skipping maintainability.

Take the next step

Have an engineer review your theme architecture

Send us the repository or a staging URL. We will look at how the theme is structured, whether the build is reproducible and where the editor can go off-brand, then send you what we find.