style.css
In the root of the directory, if it is not already there, make a file called style.css with the following content:
/*
Theme Name: Custom
*/
The theme name is the only required part of the file’s header. All available fields are:
- Theme Name: Name of the theme.
- Author: The individual or organization who developed the theme.
- Description: A description of the theme.
- Version: Theme version, in x.x or x.x.x format.
- Requires at least: Oldest WordPress version supported, in x.x format.
- Tested up to: The last main WordPress version the theme has been tested up to, i.e. 6.4. Write only the number.
- Requires PHP: The oldest PHP version supported, x.x format, number only.
- License: Theme license.
- License URI: Theme license URL.
- Text Domain: The string used for textdomain for translation. The theme slug.
In classic WordPress themes, the styles reside in style.css. However, in block themes, this file can be empty, as styling can now be handled in theme.json and in the theme editor.
theme.json
This is a configuration file for controlling editor and block settings, as well as applying default styles to blocks. To start, create a theme.json, if it is not already there, and add the following code:
{
"$schema": "https://raw.githubusercontent.com/WordPress/gutenberg/trunk/schemas/json/theme.json",
"version": 3,
"settings": {
"layout": {
"contentSize": "840px",
"wideSize": "1100px"
}
}
}
The first line, for $schema, is a helper for your editor. Hovering over fields and values gives more information about how it works
Many configuration options for theme.json will be presented in this blog. This is just the beginning.