What is a block theme and the theme.json file?

A block theme is a theme whose templates are HTML files made of blocks (in templates/ and parts/). It has no PHP templates. The design settings (colors, fonts, spacing, layout) are in theme.json, and users can change them in the Site Editor.

Terminal output

$ wp eval 'echo wp_is_block_theme() ? "block theme" : "classic theme";'
block theme
$ ls wp-content/themes/twentytwentyfive
assets
contributing.txt
functions.php
package-lock.json
package.json
parts
patterns
readme.txt
screenshot.png
style.css
style.min.css
styles
templates
theme.json

  • settings in theme.json: what the editor offers (palette, font sizes, layout width).
  • styles: the real design values, saved as CSS variables like --wp--preset--color--primary.
  • Classic themes use PHP templates and the Customizer.

See Block Themes and theme.json.


Learn more about the similar topics:
Tutorials
WordPress Themes
WordPress Top Theme List
WordPress Theme Files and Functions
WordPress Template Hierarchy
WordPress Enqueue Scripts and Styles
WordPress Loop
WordPress WP_Query Class
Exercises & Assignments
Build and activate a minimal classic theme
Show the three latest posts with WP_Query
Load a stylesheet with wp_enqueue_style and a version
Show a message only on the front page
Create a child theme which changes the footer
Interview Questions & Answers
What is a WordPress theme?
What are commonly used WordPress theme functions?
Which function is used to get the home URL in WordPress?
Which are the necessary files for a WordPress theme?
What is the use of the wp_head() function in WordPress?
What is the WordPress Loop?
What is the difference between is_home() and is_front_page()?