Skip to content

Folder Structure

Allyson Souza edited this page Dec 3, 2018 · 1 revision

Haste Starter uses the following folder structure:

haste-starter
|__ assets
|__ inc
|__ languages
|__ src
|__ template-parts
|__ vendor

haste-starter

In the root folder you'll find the WordPress theme templates, like index.php, header.php, single.php and so on. If you're not familiar with the WordPress template hierarchy, take a look.

You will find package.json, which defines the npm modules used in tasks, and some other config files like postcssconfig.js, .babelrc, .gitignore and others.

assets

Here you'll find the resources used in your theme, like JavaScript, CSS, images and fonts. If you'll work with npm tasks or other task runners, you'll probably not change those files directly.

inc

In this folder we have a lot of partial php file, each one focused in one aspect of your theme, and most of them included in functions.php (in root theme folder). We have files dedicated to enqueue styles and scripts, provide template tags, define theme features support, etc. You can extend those files or create your own files here, if you want to preserve the original structure of Haste Starter.

languages

This folder is meant to store theme translation files.

src

In this folder we have the source files of our JavaScript and CSS, here we have our expanded JavaScript and Sass files, that are processed and generates the files in assets folder.

template-parts

Here we put the theme pieces that are used in our templates of template hierarchy, we can say it's our modules to be included in our pages.

vendor

In vendor folder it's store all packages that are installed trough composer, like TGMPA.