Introduction to Block Themes

Elements of a Block Theme

This is a preview lesson
Register or sign in to take this lesson.
Length: 5 minutes

As we learned in the last lesson, a block theme consists of a collection of files contained within a directory and located in the wp-content/themes directory of a WordPress site.

Required Files

  • index.php (Required until WordPress 6.0)
  • style.css (The file that let’s WordPress know that the directory contains a theme, what it’s name is, and other useful information)
  • templates (directory)
  • templates/index.html (file inside the templates directory)
  • theme.json (a configuration file compatible with many Block Editor and Full Site Editing features)
An extremely minimal theme file structure might look like this

Most themes will contain more files than shown above. With just a couple lines of code in the style.css file the theme above could be activated successfully, though no content would display on the front end.

Next we’ll discuss each of these files in more detail.