本文档为 WordPress 开发者提供了构建主题时所需的工具和资源,涵盖块主题和经典主题的开发辅助工具、代码标准检查工具以及培训材料。
Whether you’re building your very first theme or your tenth, the following resources are meant to help ease the process. Keep in mind that there are various community tools not mentioned here as well but that still might aid in your efforts.
A block theme is a type of WordPress theme built using blocks. You can read more about these themes in the Block Theme section.
This plugin was created by various community members. This tool can create standalone block themes and child themes, depending on your needs. Here are the high-level steps:
This tool was created by Carolina Nymark and it allows you to create three different types of themes to start from:
Comparison Chart
| Tool | Child theme options? | Template creation? | Theme.json Controls | Demo content |
| Create Block Theme plugin | Yes | Yes | No | No |
| Theme Generator | No | Yes | Yes | Yes |
A classic theme is built with PHP templates, functions.php, and more. You can read more about these themes in the Classic Theme section.
The _s (Underscores) starter theme is a tool for initializing and creating a classic theme.
WordPress Coding Standards for PHP_CodeSniffer
This project is a collection of PHP_CodeSniffer rules (sniffs) that are used to validate code developed for WordPress, but can also be used when developing themes and plugins. They encompass coding style along with established best practices regarding interoperability, translatability, and security in the WordPress ecosystem, according to the official WordPress Coding Standards.
WordPress Coding Standards for PHP_CodeSniffer
The WPThemeReview Standards for PHP_CodeSniffer are a collection of sniffs that aim to automate the code analysis part of the Theme Review Process as much as possible using static code analysis.
The WPThemeReview Standards require the WordPress Coding Standards.
WPThemeReview Standards for PHP_CodeSniffer
The theme check plugin is an easy way to test your theme and make sure it’s up to spec with the latest theme review standards. With it, you can run all the same automated testing tools on your theme that WordPress.org uses for theme submissions. This allows you to resolve any issues that might come up before trying to submit your theme to the theme repository.
Site Design with Full Site Editing: Part 1, Part 2, Part 3
Creating a landing page with a block theme
Building a home page with a block theme
Using Schema with WordPress theme.json
Create a Basic Child Theme for Block Themes
Find more theme lessons on learn.wordpress.org.