12 Tips to Build Your First WordPress Theme (Block Themes, 2026)
Want to build your first WordPress theme? Guest author Sandip Dedhia spent 20 days on his first theme in 2008 and shared the lessons that would have saved him time. Theme building has changed a lot since then: block themes use HTML templates and a theme.json file instead of lots of PHP, and you can design much of a theme visually in the Site Editor. Here are 12 essential tips to build your first WordPress theme in 2026.

Quick answer: Start from a default block theme such as Twenty Twenty-Five, or use the free Create Block Theme plugin to export your Site Editor design as a new theme. Set colours, fonts and spacing in theme.json, build templates from blocks and patterns, work on a fresh local WordPress install, never hard-code URLs, and test with Theme Check and accessibility tools before sharing it.
Table of Contents
Block theme or classic theme?
- Block themes (recommended): templates are HTML files made of blocks, global styles live in
theme.json, and users can customise everything in the Site Editor. - Classic themes: PHP templates like
index.phpandsingle.php. Still supported, and fine if you prefer PHP or need to customise an existing classic theme.
12 tips for your first WordPress theme
- Don’t start from scratch. Copy a default theme or use the Create Block Theme plugin to generate a starter theme from the Site Editor.
- Consider a child theme if you only want to change an existing theme; your changes survive parent updates.
- Use a fresh, local WordPress install. Sandip lost days because his old test blog had edited core files. Tools like WordPress Studio or LocalWP give you a clean site in minutes.
- Get the essentials right. A block theme needs
style.css(with the theme header),theme.jsonandtemplates/index.html. A classic theme needsstyle.cssandindex.php. - Put design settings in theme.json: colour palette, font sizes, spacing and layout widths. It keeps styles consistent and editable.
- Build with patterns and template parts. Reusable headers, footers and sections keep code modular and save time.
- Never hard-code URLs, paths or text. Use functions like
get_theme_file_uri()and make text translatable if you plan to share the theme. - Turn on debugging. Set
WP_DEBUGto true in a local site to catch errors and deprecated functions early. - Avoid deprecated code copied from old tutorials; check the official handbook for current functions.
- Keep it lean. Fewer scripts, fonts and database calls mean a faster theme. Load only what each page needs.
- Test thoroughly with the Theme Unit Test data, the Theme Check plugin, different screen sizes and keyboard navigation.
- Ask for help. The Theme Handbook and WordPress support forums are excellent.
You don’t need to be a PHP expert
With block themes, much of the work is HTML, CSS and JSON, and the Site Editor lets you design visually. Sandip’s advice still holds: start small, reuse good code, and learn as you go. We built several free classic themes for QuickOnlineTips years ago. One lesson from that: never add footer links back to your site in themes you give away, as those links later looked like spam and hurt our rankings.
When your theme is ready, keep it fast: see how to make WordPress faster and safer and the essential web design elements every theme needs.
FAQ
How long does it take to build a WordPress theme?
A simple block theme can take a weekend; a polished, public theme takes weeks of testing.
Can I sell my WordPress theme?
Yes, but themes must be GPL-compatible. To list it on WordPress.org it must pass the theme review requirements.
What is theme.json?
A configuration file that defines a theme’s colours, typography, spacing and which editor features are available.
Originally written by guest author Sandip Dedhia of BlogsDNA, who blogged about technology, Linux and blogging tips. Updated for 2026 by QuickOnlineTips.
Stuck on a gift? Try our free Gift Idea GeneratorIdeas for anyone by age, job, interests and budget, with Amazon.com and Amazon.in linksFind gifts →Get our free weekly email: new tech guides and tools, no spam.
New and updated tech guides, a free tool worth bookmarking and one useful pick, once a week. No spam, unsubscribe anytime.
One email a week. Unsubscribe anytime. See our privacy policy.





Very informative. Actually, I never tried to create a wordpress theme. Planning to create one in feature.
Hope someone can help. The Codex site is useless–most posts are unanswered!
Basically I am having trouble initializing variables in header.php and then accessing them later in, say, footer.php.
What am I missing? Aren’t these files loaded sequentially and therefore the variables should be initialized and set and then accessible?
@Erick – You might be missing some code in header.php or footer.php. Match your files with the default template.
I agree with Susan, if you’re a blogger that really has no time to spare.. taking up a theme you like an playing with its css code is a good idea.. good article tho ^^
Great tips on getting started, but I would rather take an existing free theme and do some touches.
Good post there Sandip :)
I have never did or tried to build a wordpress design. But will have to try out with these tips!