← All work

Ashlar WordPress Theme

A WordPress starter theme built around reusable components, structured ACF blocks, and a modern frontend toolchain. Now in its third version.

Status
In daily use
Stack
  • WordPress
  • PHP
  • Tailwind CSS
  • TypeScript
  • ACF Pro

Overview

Ashlar is a WordPress starter theme I’ve been building and refining since 2021. What started as an ACF-powered theme has gradually evolved into a component-based setup that I now use as the foundation for client WordPress projects.

It’s currently on its third version, bringing together ACF Pro, Tailwind CSS v4, TypeScript, Alpine.js, and Vite. The focus has always been on keeping the code organized, making components reusable, and having a consistent way to build and maintain WordPress sites.

It also serves as the foundation for the Ashlar WP-CLI tools I built for Figma token conversion and ACF template generation.

The problem

As WordPress projects grow, themes can become difficult to maintain. Templates start accumulating unrelated logic, field definitions get out of sync with their corresponding markup, and styling conventions become harder to follow across different components.

I wanted a starter theme that could handle different types of client projects without having to rethink the architecture every time.

It also needed to be approachable for other developers joining a project, with clear conventions for where things belong and how new components should be built.

What I built

Component-based architecture

The theme is organized around reusable components rather than putting everything into large template files.

Layouts and reusable elements live in template-parts/, while ACF blocks have their own folders under acf/blocks/. Each block keeps its field definitions, render.php, and related assets together, making it easier to work on individual components without affecting unrelated parts of the theme.

ACF Pro and StoutLogic ACF Builder

All ACF fields are defined in PHP using StoutLogic ACF Builder instead of being managed separately through the WordPress admin.

Fields are organized into component-specific groups, with flexible content for page-builder layouts and repeaters for structured content. Global fields and theme options are maintained separately under acf/global-fields/.

Keeping field definitions in code also makes them easier to version, review, and maintain alongside their corresponding templates.

Tailwind CSS v4 and SCSS

Tailwind CSS v4 handles most of the styling through utility classes, using the official Tailwind CLI for compilation.

SCSS is kept for variables, mixins, and base styles rather than duplicating what Tailwind already handles. Design tokens are exported from Figma and converted into CSS theme files through the companion WP-CLI tool.

TypeScript and Alpine.js

Frontend logic are written in TypeScript, following established coding conventions and keeping the code consistent and maintainable.

Alpine.js handles common interactions such as tabs, modals, dropdowns, and toggles without introducing jQuery or a larger frontend framework.

Vite build setup

Vite handles the frontend build, with separate Tailwind and Vite processes during development. Watch mode and BrowserSync make it easier to see changes while working, while production builds generate the assets needed for deployment.

WooCommerce integration

WooCommerce-specific functionality is kept separate in inc/woocommerce.php, including custom product gallery behavior and store template adjustments.

This keeps e-commerce customizations from spreading throughout the rest of the theme.

Code quality and developer tooling

The theme includes a collection of tools to keep the codebase consistent:

  • PHP_CodeSniffer with WordPress Coding Standards.
  • ESLint and Stylelint for JavaScript, TypeScript, and stylesheets.
  • Prettier with the Tailwind CSS plugin.
  • Composer and Node.js for dependency management.
  • Internationalization helpers for translation-ready development.

Working with AI coding tools

Ashlar also includes dedicated agent instructions and skills to make working with AI coding tools more consistent. These are maintained in the theme’s .agents/ directory, which contains AGENTS.md and SKILL.md files with project conventions, development guidelines, and specific instructions for working with StoutLogic ACF Builder.

This gives AI coding agents the context they need to follow the theme’s existing architecture, define ACF fields correctly, and build components that fit into the project rather than introducing their own patterns.

The StoutLogic ACF skill is particularly useful when creating or modifying ACF blocks, helping agents follow the established field-building conventions. The companion acf-gen CLI tool complements this by validating field definitions and generating matching render templates.

Generated code still goes through developer review, but having these instructions and tools in place makes AI-assisted development much more predictable and easier to maintain.

Tech stack

WordPress, PHP, ACF Pro, StoutLogic ACF Builder, Tailwind CSS v4, SCSS, TypeScript, Alpine.js, Vite, Composer, Node.js, WooCommerce.

Outcome

Ashlar is now in its third version and remains in daily use as the starting point for client WordPress projects.

Over the years, I’ve continued refining its architecture, build process, and development conventions instead of starting from scratch for every project.

It also provides the foundation for the Ashlar WP-CLI tools, extending the workflow beyond theme development into design-token conversion and ACF code generation.

What I learned

A starter theme is something you build for the projects you’ll work on years from now, not just the one you’re working on today.

One of the biggest things I’ve learned from maintaining Ashlar is the value of having clear boundaries. Keeping field definitions, templates, frontend behavior, and styling in their own places makes the code much easier to work with as a project grows.

I also found that consistency matters more than having the latest tools. A predictable structure makes it easier for another developer to understand the codebase, and it gives automated tools something reliable to work with.

That’s what I wanted Ashlar to become: a foundation I can keep improving and confidently use across different projects.