0 of 6 lessons complete (0%)
Creating a Bare-Bones Theme – Just the Basics

Create index.php and theme.json files

This is a preview lesson
Register or sign in to take this lesson.

Next we’ll create a couple more files for our theme

Step One

Create a file named index.php in the first-block-theme directory. This file does not serve a functional purpose beyond fulfilling a requirement of WordPress that the file must exist. Shortly, you will create another file that will do what this file would do in a “Classic” theme. In a future version of WordPress this file will no longer be a requirement of WordPress but it will remain best practice to include it.

<?php /* This file is intentionally left empty */
Code language: HTML, XML (xml)

Step Two

Create a file named theme.json in the first-block-theme directory.

This file will serve as the configuration file for your theme and will be populated with more content as your progress through the theme creation process.

For now add the following to the file:

{ "version": 2 }
Code language: JSON / JSON with Comments (json)