| extends | docs |
|---|---|
| title | Installation |
| group | Getting Started |
| prev | introduction |
| next | configuration |
| order | 2 |
Tonik Starter Theme uses Composer and NPM to manage its dependencies. Make sure you have both installed on your machine before using this starter.
A starter has a few dependencies. They are extracted to separate packages for easy installation and managing via Composer and NPM package managers.
- tonik/gin (required) - Theme foundation which provides all custom functionalities
- tonik/cli (optional) - Simple CLI for initiating theme
WordPress themes lives in the wp-content/themes folder. This is where we have to fetch our fresh starter files.
# Go to the `themes` directory of your WordPress installation.
$ cd wp-content/themesCreate project via composer create-project composer command.
$ composer create-project tonik/theme <theme-name>You can also directly download or clone the repository to the wp-content/themes directory.
# Clone repository to the <theme-name> folder.
$ git clone -b master git@github.com:tonik/theme.git <theme-name>You will find more detailed instructions about managing and building a theme in Development documentation.
In order to property bootstrap a theme, you have to fetch some required dependencies and compile its assets. Before that, make sure that you are in the root folder of the theme (where package.json and composer.json files are located).
# @ wp-content/themes
$ cd <theme-name># Install composer dependencies.
$ composer install# Install node dependencies.
$ npm installLet's prebuild the theme to avoid error about missing enqueued assets.
# Build a theme for development.
$ npm run devNow, you are ready to turn on your newly created theme. Go to the WordPress admin panel and activate the theme on Appearance > Themes page. Familiar with WP-CLI? Use theme activate command.
# Activate newly created theme.
$ wp theme activate <theme-name>