Skip to content

Themes

wesleytodd edited this page · 1 revision

Installation

Durring the setup process, yo wordpress, you are asked if you want to install a custom theme. If you select yes, you will be asked a few questions about where the theme files are located. The first question is, "Theme source type (git/tar)". If the theme is a git repo hosted on GitHub, then you can select the git option. This will then prompt you for the GitHub username, repository and branch you wish to install from. The defaults (wesleytodd, yeopress, tempalte) will install the default theme found here. If you select tar, you can provide any url where YeoPress can download the tarball. It will then extract it into the theme directory specified.

Setup Task

Durring the installation, YeoPress will attempt to run npm install and grunt setup. If your theme has a correctly formatted package.json and the Gruntfile registers a setup task, then it will be run. This task can do anything necessary to get the template setup. For example, the default theme's looks like this:

grunt.registerTask('setup', function() {
    var done = this.async();
    var bower = require('bower').commands;
    bower.install().on('end', function(data) {
        done();
    }).on('data', function(data) {
        console.log(data);
    }).on('error', function(err) {
        console.error(err);
        done();
    });
});

Gruntfile

As someone who works with WordPress I am sure you know that we spend most of our time in that theme directory. You can usually get around without having to directly touch anything else in the WP installation. It is because of this that I decided to place the Grunt tasks in the individual theme directories. This enables theme developers to customize Grunt to their particular theme setup and structure.

Something went wrong with that request. Please try again.