Skip to main content

Create a new WordPress theme

Let's create a new theme!

Navigate to your WordPress theme folder and run the following command:

npx create-wp-project

The script will prompt you for a theme name and local development URL (used for BrowserSync). After that, your new theme will be installed:

After the script is finished, your new theme will be set up and activated.

Specify version to create

If you want to specify a version of Eightshift Libs or Frontend Libs to use, you can use add two additional attributes to this command to specify a branch or release to use:

  • --eightshiftLibsBranch
  • --eightshiftFrontendLibsBranch

Example:

If you want to pull the develop branch of the Eightshift Frontend Libs and a specific release of the Eightshift Libs:

npx create-wp-project --eightshiftLibsBranch="release/3.1.0" --eightshiftFrontendLibsBranch="develop"

You can also specify the version of the create-wp-project script like this:

npx create-wp-project@2.0.12 --eightshiftLibsBranch="release/3.1.0" --eightshiftFrontendLibsBranch="develop"

You can get a list of available script arguments by running:

npx create-wp-project --help
Tip

You can specify both libraries at once or only one.

What is next?

Now that we've set the theme up on your local environment, let's do something with it.

Please make sure you read the Basics chapter to understand better how the project is set and what is included to make your developing experience as smooth as possible.