WordPress theme development involves creating or adapting the design layer, templates, and website settings without transferring business logic to the theme. You choose the architecture—classic, child, or block—based on the editor, scope of changes, performance, and future support.
In this guide you will understand what the theme is responsible for, what Full Site Editing is and theme.json These differ from the classic approach when developing a WordPress child theme and how to prepare a theme for a unique design. We'll also cover project structure, a secure workflow using staging and backups, checking compatibility with the WordPress version and plugins, and common errors that can cause updates to overwrite changes.
How to choose between a theme, block, plugin, and integration, explains A general guide to custom WordPress development. Themes and templates are discussed in detail here.
What does a WordPress theme do?

A WordPress theme is responsible for the presentation of content: page appearance, template selection, element layout, and interface styles. It determines how visitors see posts, categories, archives, and other content, but it shouldn't contain the site's critical business logic. This separation simplifies design changes and future project maintenance.
Presentation and templates
When processing a request, WordPress retrieves data from the database, determines the page type, and selects the appropriate theme template. The template defines the output structure, such as the layout of the header, main content, navigation, and additional areas. Theme styles and settings are responsible for colors, typography, spacing, and adapting the interface to different screen sizes.
Depending on the project architecture, the presentation may be generated by PHP templates or block templates. Design settings may also be located in stylesheets, theme files, and configuration files. theme.json. The specific set of files depends on the type of theme and project requirements.
Before you begin developing a WordPress theme, determine which decisions relate specifically to the interface. A theme's responsibilities typically include:
- layouts of individual posts, pages, archives and search results;
- output of header, footer, menu and content areas;
- visual parameters of blocks and components;
- connection of styles and scripts necessary for design;
- options for presenting the same content;
- adaptive behavior of interface elements.
If it is planned creating a website on WordPress With a unique design, first establish page types and interface states. It's helpful to include website development brief A list of templates, mobile version requirements, accessibility, content editor, and acceptable design customization methods. This helps ensure that design doesn't confuse features that need to be preserved after a theme upgrade.
What is better to put into a plugin?
A plugin should include features that are essential to the site regardless of its appearance. The practical criterion is simple: if a feature and the data it creates must remain accessible after a theme change, it shouldn't be tied exclusively to the current design.
This logic may include registration of custom post types and taxonomies, integration with third-party services, form processing, special user roles, access rules, and business processes. A theme can implement the plugin's output, but it shouldn't be the only place where the functionality required by the site is implemented.
For example, a project catalog can be stored as a separate content type registered by a plugin. The theme then defines the project card, the individual project page, and the archive view. After changing the design, the catalog data will be preserved, and new templates can be created for it.
The line isn't always clear. Minor output customizations can be built into a theme, while handling user input requires special attention to access rights, validation, and data escaping. Compatibility of the chosen solution can't be guaranteed without checking the WordPress version, active plugins, and the specific theme. Implement any changes first on a staging environment and back up the live site.
Classic, Child, and Block Themes

Choose a theme based on the scope of changes and the site editing method. A classic theme is suitable for a familiar architecture with PHP templates, a child theme preserves modifications when updating the parent theme, and a block theme allows you to manage most of the layout through the website editor and Full Site Editing.
| Topic type | The main task | Restrictions |
|---|---|---|
| Classical | Create an interface based on PHP templates, menus, widget areas, and theme settings | Changing global parts of a layout often requires code; editor capabilities depend on the theme implementation. |
| Subsidiary | Safely customize an existing classic or block theme | Dependent on the parent theme; updates to the parent theme may change the layout, styles, and functionality. |
| Block | Edit templates, headers, footers, and other areas using blocks | We need to check compatibility with the WordPress version, plugins, and required blocks. |
The classic theme remains a reasonable choice if the project relies on PHP logic, a pre-configured Customizer, or plugins designed for traditional templates. For a catalog with complex post types, the classic theme can be convenient if the data presentation is tied to server-side logic. Performance, however, is determined by the quality of the code, the number of resources, queries, and extensions.
When do you need a child theme?
Developing a child WordPress theme is necessary when you want to modify an existing theme without losing your changes after updating it. You can move your own styles, overridden templates, and additional functionality into a child theme, while continuing to use the unchanged parts of the parent theme.
This approach is suitable for redesigning individual pages, adjusting the header or footer, incorporating custom styles, and making minor behavioral changes. However, a child theme doesn't isolate the project from changes in the parent theme. If an update changes the template structure or removes the underlying mechanism, your overrides will need to be reviewed and possibly adapted.
Before modifying, check whether the parent theme is supported, whether it matches the version of PHP and WordPress you are using, and whether it is compatible with critical plugins. Important and WordPress support From the theme developer's perspective: documentation and the changelog help assess the impact of an update. Conduct the test on a staging copy with a current backup, not on the production site.
When do you need a block theme?
WordPress block theme development is appropriate if you want to manage not only post content but also global templates through the site editor. In a block theme, the header, footer, archives, and other areas can be assembled from blocks, and theme.json Sets general design settings: colors, typography, spacing, and available editor tools.
Block architecture is suitable for unique designs when they can be consistently expressed through templates, template parts, patterns, and global styles. It's also convenient when a project manager needs to independently change page composition without constantly editing PHP.
When choosing a WordPress theme architecture, consider three criteria: editor compatibility with required plugins, template support by the team, and the impact of selected blocks on performance. Don't promise full compatibility upfront: this can only be confirmed after testing the specific theme, WordPress version, plugin set, and custom scripts.
Structure of the project topic

Main files and templates
The structure depends on the theme architecture. For a classic theme, the required foundation is style.css with metadata and index.php — a backup output template. In a block theme, the base template is located in templates/index.html, and global settings are usually described through theme.json.
In the classic architecture, WordPress selects files according to the template hierarchy. For example, single.php responsible for individual records, page.php - per page, archive.php - for the archives, and 404.php — for reporting a missing page. Common parts of the interface are usually moved to header.php, footer.php and catalog template-parts.
Don't create a separate template for each URL unless necessary. First, determine the content type and check whether a common markup with controlled parameters can be used. A separate PHP template is only necessary for a truly unique structure that can't be supported by a standard page template or blocks.
In a block theme, templates are stored as HTML markup for blocks in a directory templates, and the repeated elements are in parts. The header, footer, and other areas can be edited using Full Site Editing, if supported by your WordPress installation and chosen theme.
For the child theme, create a separate directory. style.css Specify the parent topic using the field Template. Copy custom templates only when necessary: a child theme's file replaces the corresponding parent theme's template, so it will need to be maintained during subsequent updates.
Styles, scripts and settings
File functions.php They are used to include theme features, styles, scripts, and handlers. CSS and JavaScript should be included through standard WordPress mechanisms, rather than hard-coded into templates. This preserves dependencies, load order, and compatibility with resource optimization.
assets/css— styles of components and pages;assets/js— user scenarios;assets/images- graphics related to design;inc- small PHP modules that can be plugged in fromfunctions.php;languages— localization files, if the theme is prepared for translation;theme.json— palette, typography, sizes, spacing, and other editor and interface settings.
theme.json This helps align the editor with the site's appearance and reduce the number of disparate CSS rules. However, the available options depend on the schema and WordPress version, so compatibility should be verified rather than assumed.
Marketing language shouldn't dictate the technical structure of directories. Choose file names based on the purpose of the components, and store regional and commercial data in content, settings, or record fields.
Don't put business logic in the theme: forms, custom data types, and functions that need to persist after a design change are best implemented in a plugin. When working with PHP, consider access rights, validate input data, and escape output. Make structural changes to staging copies first after backing up the site.
Development and verification procedure

Safe WordPress theme development doesn't start with changing code on a live site, but with documenting requirements, creating a test copy, and preparing test scripts. The result should only be published after testing the templates, responsiveness, accessibility, performance, and compatibility with the environment.
Working on a test copy
First, determine which pages and features will be affected by the change. Even minor template adjustments require clear criteria for completion: which blocks should appear, who will be able to edit them, and how they behave when there's no content.
Deploy a staging copy with a WordPress version, theme, plugins, and PHP settings as close as possible to the production site. Before transferring files or data, create a backup and ensure it can be restored. Restrict access to the staging environment: disable indexing, use authentication, and do not transfer real personal data unless necessary.
Practical order of work:
- Record requirements, layouts, and a list of modifiable templates.
- Create a backup and test environment.
- Set up a version control system and a separate task branch.
- Make changes in small, logical steps.
- Check user rights before performing administrative actions.
- Validate input and escape output based on context: HTML, attribute, URL, or JavaScript.
- Test the main scenarios and transfer to staging.
- Prepare a publishing and rollback plan.
Agree on the editor's workflow: which elements the client can change independently, which fields are required, and what happens with long titles, empty images, or content inserted from an external source.
Mobile version, availability and updates
Test your theme beyond just the master page. Use posts with short and long text, galleries, tables, comments, search results, error pages, and empty states. On mobile screens, monitor horizontal scrolling, interactive element sizes, navigation, forms, and images. Changing the viewport width alone isn't enough: whenever possible, test the interface on real devices and in multiple relevant browsers.
For basic accessibility, navigate the page using a keyboard. Focus should be visible, navigation should be logical, and menus and dialogs should be navigated without a mouse. Maintain the semantic structure, field labels, alternative descriptions for meaningful images, and sufficient contrast. Automatic checking can help detect some issues, but is not a substitute for manual review.
Before releasing, update the test copy and retest:
- key templates and blocks in the editor and on the website;
- forms, search, menus, pagination and error messages;
- user roles and access to settings;
- download speed, resource sizes and absence of errors in the log;
- update the theme without losing user settings;
- the ability to quickly return to the previous stable version.
You can't promise compatibility based solely on the name of a theme or plugin. Compatibility is confirmed by testing specific versions of WordPress, PHP, the active theme, extensions, and server configuration. After publishing, clear the cache, run a short test, and monitor for errors without directly modifying the live code.
Common mistakes when developing a theme
Modifying parent theme files
If you're editing a pre-existing theme directly, updating it may overwrite your changes. For local modifications, use a child theme, and test the results on a staging copy of the site before updating. Store project-critical settings and code in version control.
However, a child theme doesn't eliminate all risks. Changes to the parent theme's templates, functions, or styles may affect overridden files. Compatibility should be tested with specific versions of WordPress, the theme, and active plugins.
Placing functionality in a theme
A theme is primarily responsible for the website's presentation. Functions that need to be preserved after design changes are best handled in a separate plugin. These include custom post types, integrations, utility APIs, and business logic.
Catalog card data and its processing rules shouldn't be rigidly tied to a single design. Otherwise, changing the design could disrupt important functionality, even if the records remain in the database.
Ignoring output and input security
One of the most dangerous mistakes is outputting data without escaping. Choose the escaping function based on the context: text, HTML attribute, URL, or a limited set of HTML. Input data must be validated for the expected format and sanitized before saving.
For administrative actions, check user permissions and WordPress one-time security values. Don't rely solely on a hidden form field or a page inaccessible from the menu. Before adding a third-party code snippet, find out what data it accepts, where it passes it, and what permissions it uses.
Dependency on specific editor markup
A theme may look correct on a prepared demo page, but break when loaded into real content. Check for long headings, images of varying proportions, tables, lists, galleries, nested blocks, and empty states. For a block-based theme, monitor templates, template parts, and settings separately. theme.json.
Don't claim full compatibility with the editor or Full Site Editing without testing the necessary scripts. The presence of block templates alone does not guarantee the correct operation of third-party blocks and plugins.
Connecting extra resources
Loading all styles and scripts globally increases page size and can create conflicts. Connect resources via the WordPress API, load them only where needed, and avoid adding multiple libraries for a single task. Evaluate performance on different page types, not just the homepage.
Development directly on the production site
Even a minor PHP edit can cause a critical error, and a template change can break the application page. Work in a staging environment, create a backup of your files and database, commit changes, and plan for rollbacks in advance.
Check not only the appearance, but also the functionality of forms, analytics, metadata, and page content: a template error can affect several functions simultaneously.
Lack of final verification
Before publishing, test responsiveness, keyboard navigation, contrast, forms, system templates, 404 pages, search, and no-content states. Review error logs and ensure no debug messages are displayed to visitors. Complete theme development only after verifying user roles, backup recovery, and basic visitor interactions.
Official documentation: WordPress theme development guide.