Skip to main content

WordPress Custom Theme from Scratch

Build a WordPress theme from scratch — theme.json, block patterns, template parts, custom post types, and full-site editing support.

Vul de plaatshouders in

Edit the values, then copy your finished prompt.

Jouw Prompt
prompt.txt

                                

What this prompt does

This prompt scaffolds a complete WordPress [theme_type] theme named [theme_name] for a [site_type] site. It generates a theme.json with a [color_count]-color palette plus typography and spacing tokens, block patterns for your [patterns], template parts (header, footer, sidebar), custom templates from [templates], custom post types from [post_types] with meta boxes, taxonomies from [taxonomies], a functions.php with proper enqueuing, Customizer options for [customizer_options], responsive design via [css_approach], and performance touches like lazy loading and critical CSS.

The structure works because modern WordPress theming starts from theme.json and full-site editing, not scattered PHP templates. Defining the token palette first means every pattern and template inherits consistent colors, type, and spacing. The [theme_type] variable decides whether you get a block (FSE) theme or a classic one, while [patterns] and [templates] determine how much reusable layout the editor gets out of the box.

When to use it

  • You're starting a custom theme and want a theme.json token foundation, not a starter clone
  • You need block patterns for [patterns] like hero, pricing, and FAQ ready for editors
  • You want custom post types from [post_types] and taxonomies wired up from the start
  • You're building a [site_type] site and want full-site-editing template parts in place
  • You need Customizer options for [customizer_options] so clients can self-serve
  • You want performance baked in — lazy loading, asset optimization, critical CSS

Example output

Expect a theme skeleton: a theme.json with your [color_count] palette and tokens, block pattern files, header/footer/sidebar template parts, the custom templates, registered post types with meta boxes, taxonomies, a functions.php with clean enqueuing and theme supports, Customizer settings, a style.css header, and a screenshot.png placeholder. It targets theme unit test compatibility.

Pro tips

  • Set [theme_type] deliberately — "block (FSE)" gives full-site editing, while a classic theme suits sites that aren't ready for it
  • Define [color_count] to match a real palette; an inflated number produces unused tokens that clutter the editor
  • Use [css_approach] consistently with theme.json tokens so colors and spacing stay single-sourced
  • Pick [patterns] and [templates] your editors will actually reuse rather than every possible layout
  • Treat the generated functions.php enqueuing as a baseline and confirm dependencies and versions before shipping
  • Validate against the theme unit test data — generated themes often miss edge cases like long titles and nested comments

Frequently Asked Questions

Does this build a block (FSE) theme or a classic theme?
You choose with the `[theme_type]` variable. Setting it to block (FSE) produces a full-site-editing theme built around `theme.json`, while a classic value gives traditional PHP templates. Pick based on whether your editors and site are ready for full-site editing.
Are the colors and spacing actually consistent across the theme?
They should be, because the prompt defines a `[color_count]` palette and spacing tokens in `theme.json` first, then has patterns and templates inherit them. Using `[css_approach]` with those same tokens keeps colors and spacing single-sourced rather than hardcoded in scattered files.
Will the generated theme pass theme unit tests?
It targets theme unit test compatibility, but you should still run the official test data yourself. Generated themes commonly miss edge cases like very long titles, deeply nested comments, and unusual content, which the unit tests are designed to catch.
Can clients customize it without touching code?
Yes, it generates Customizer options for whatever you list in `[customizer_options]`, such as logo, social links, and color scheme. Combined with full-site editing patterns, this lets clients self-serve common changes without editing PHP or templates directly.
Engr Mejba Ahmed

Need this built for real?

Engr Mejba Ahmed

AI Developer · Software Engineer

I'm Mejba — I design and ship production AI systems, automations, and full-stack apps. If you want this turned into a working solution for your team, let's talk.

Meer in WordPress & CMS Prompts

Engr Mejba Ahmed

Engr Mejba Ahmed

Claude Code Expert · Online

👋

Hey there!

Quick Actions

WhatsApp Instant reply

Chat on WhatsApp

+880 1723 741224 · Instant reply

Popular Questions

Engr Mejba Ahmed is connected
Engr Mejba Ahmed is typing...
Engr Mejba Ahmed avatar

✉ Want me to follow up? Drop your email

Engr Mejba Ahmed avatar

📞 Connect Directly

Choose how you'd like to reach me

WhatsApp

+880 1723 741224

Email

[email protected]

✓ Details sent! I'll get back to you shortly.

Powered by OpenAI

335+

Blog Posts

25

AI Courses

63

Projects

Services & Expertise

Pricing & Process

Learning & Resources

Connect & Support