Scratch, A WordPress Theme Generator

Scratch is a Yeoman Generator that will scaffold a WordPress theme based on _s and Foundation. The goal of this project is to be a starting point. After generating a new theme from Scratch, you’ll be able to compile Sass, concat js, and minify to create a production package of your theme.

Setup

Install Yeoman

Install Grunt.js

Install Bower

Install generator-scratch

Lot’s of code will happen. This may take a few minutes. Go make a beverage! When it’s done you can use the generator like so… Navigate to your development WordPress theme folder [change path as needed]:

Run the generator

You will be prompted with a few basic questions to help the setup get started. Once you get past the description question you will again see lots of code. That’s grunt and bower doing their thing. It’s also time to drink your beverage!

Navigate to your new theme:

In the root of your theme, run the following:

Development

In your wp-content/themes folder you will now have a folder with the name of your theme which is setup with the basics to get a theme off the ground quickly. In the root of your newly created theme you’ll have the following grunt tasks you can run:

Production

When you’re done and ready to go live you’ll need to minify your assets and whatnot. You can do this by using:

This will minify all your assets and copy the theme to a dist/ directory then compresses to a .zip.

npm & GitHub

2 thoughts on “Scratch, A WordPress Theme Generator

Leave a Reply