Go to main content

All Articles

Code · 4Min Read

Building a Custom WordPress Themethat clients can actually edit.

How I structure custom WordPress themes so the people who run the site can update it without breaking it: content model first, blocks second, templates last.

Herald Flores
Frontend Engineer and Talent Acquisition

  • WordPress
  • Gutenberg
  • ACF
Share

A custom theme is not finished when the design looks right in the browser. It is finished when the person who runs the site can publish, edit and reorganize content on a Monday morning without calling a developer.

I have built custom WordPress themes for agencies and their clients since 2019, including the platform for iDeal Costa Rica Real Estate, where we moved more than 1,600 property listings from Joomla, and the rebuild of Aurum Speakers Bureau, with more than 1,000 speaker profiles. Both projects taught me the same lesson: the theme is a tool for editors, and its quality shows in the admin, not only on the front end.

This is the order I follow.

Start with the content model, not the design

Before writing a template, I list every type of content the site has and what each one needs. A speaker profile, a property listing and a blog post look different, but more importantly they behave differently: different fields, different filters, different relationships.

That list turns into three decisions:

  • Custom post types for content with its own structure and archive, such as properties or speakers.
  • Taxonomies for the ways people browse that content, such as categories, locations or specialties.
  • Fields for structured data that should never live inside a paragraph, such as price, bedrooms or a speaker’s topics.

When structured data lives in fields instead of free text, filtering, sorting and migrating become straightforward. On iDeal, mapping Joomla content to a clean WordPress data model was the first task, before any visual work, because 1,600 listings had to land in the right fields in two languages.

register_post_type( 'property', [
  'label'        => __( 'Properties', 'theme' ),
  'public'       => true,
  'has_archive'  => true,
  'show_in_rest' => true, // required for the block editor
  'supports'     => [ 'title', 'editor', 'thumbnail', 'excerpt' ],
  'rewrite'      => [ 'slug' => 'properties' ],
] );

Choose the right tool for each kind of content

Not everything needs a block, and not everything needs a field. I use a simple rule to decide.

Content Best tool Why
Structured data (price, location, dates) ACF fields Queryable, consistent, easy to migrate
Page sections the editor arranges Custom Gutenberg blocks Flexible layout with guardrails
Repeated layouts (listing, profile) Templates Same structure on every entry
Long form text Core blocks Editors already know them

The mistake I see most often is the opposite: a page builder where every page is a one-off, so the site looks consistent only until the first edit.

Build blocks with guardrails

Custom blocks are where a theme becomes pleasant to use. A good block gives editors freedom in the right places and none in the wrong ones.

  • Limit the options. If the design has three section styles, the block offers three, not a color picker.
  • Preview what will ship. The editor view should match the front end closely enough that nobody needs to publish to check.
  • Name blocks after their purpose. “Speaker Highlights” is easier to find than “Two Column Grid”.
  • Lock structure when it matters. Templates can lock the order of required blocks so a listing never loses its gallery.

On Aurum, reusable Gutenberg blocks and page templates let the team build new pages from tested pieces instead of starting from a blank canvas each time.

Keep templates boring

Templates should be predictable. Every property page renders the same parts in the same order from the same fields. That predictability is what lets you change a layout once and have it update everywhere.

I keep presentation logic in template parts and data access in small functions. When a template needs a query, such as related listings or speakers in the same category, it calls a function that is easy to test and reuse instead of building the query inline.

Plan search and filters early

Filters are usually the feature visitors use most, and they depend completely on the content model. If price is a number in a field, filtering by price is simple. If it is text inside a paragraph, it is not possible.

For Aurum, speaker search and filtering ran on WordPress queries and URL parameters, which also gave every filtered view a shareable link. For iDeal, advanced property filters and a comparison plugin were built on top of the same structured fields defined at the start.

Treat migration and SEO as part of the theme

On a redesign, the new theme is only half of the work. The other half is getting existing content into it without losing what the old site had earned.

  • Map every old URL to a new one and add redirects for the ones that change.
  • Preserve titles, descriptions and media, not just body text.
  • Migrate both languages together if the site is multilingual.
  • Check indexed pages after launch and fix what search engines report.

On iDeal, preserving indexed URLs and handling redirects was part of the same plan as the theme, not an afterthought on launch day.

A short checklist before handover

  • Every content type has its own post type, fields and template.
  • Editors can create the most common page without developer help.
  • Blocks offer only the options the design supports.
  • Filters and search work from structured fields.
  • Old URLs redirect, and both languages are migrated.
  • The site passes a basic accessibility and performance review.

A custom theme earns its cost when the site keeps improving after the developer leaves. Designing for the editor, not only for the visitor, is what makes that possible.

Share this article

If it helped, send it to someone who would find it useful.

Share on LinkedIn

Keep Reading

All Articles