3ev's WordPress starter kit
A modern Wordpress environment
This is the base WordPress environment that we use at 3ev. It borrows heavily from many of the ideas in the excellent Bedrock project.
- Dependency management with Composer
- Configuration management with Phpdotenv
- A modern folder structure
- WP CLI command line tools
- Modern plugin and theme development with Wordpress Core
- A frontend workflow using Gulp, Sass and Browserify
- Phingy for build scripts and database management
- Ruby/Rubygems/Bundler if you want to use Capistrano deployments
$ composer create-project 3ev/wordpress-starter -s dev $ cd wordpress-starter/ $ bin/init
This will install dependencies, prompt you for any configuration, compile assets, install Wordpress and start your site running on Apache.
Once you've setup your WordPress site, you can easily create new builds for development or production. First, dump out your database with:
$ bin/phing db:structure:dump $ bin/phing db:data:dump
and push to S3 to distribute the files, then all developers have to do is:
$ git clone firstname.lastname@example.org:you/your-wordpress.git my-wordpress-site/ $ cd my-wordpress-site/ $ bin/build
to get a working copy of your site.
Wordpress Starter comes with a single theme, "3ev Starter Wordpress Theme" (
public/app/themes/starter/), which is ready
This theme includes the following:
v3with touch detection and
mqAPI (included in this repo)
Where possible, you should always try to use NPM to install frontend packages. They're bundled with Browserify, and you
can use Browserify Shim (configure at
public/app/themes/starter/assets/js/shim.js) to bundle any incompatible libraries.
Wordpress Starter includes some Gulp tasks to make it easy to compile your assets. These are run automatically when building locally or deploying with Capistrano.
# Compile JS from `public/app/themes/starter/assets/js/main.js` $ node_modules/.bin/gulp build:js # Compile Sass from `public/app/themes/starter/assets/css/main.sass` $ node_modules/.bin/gulp build:css
You can also compile all assets or watch for changes during development - just use
gulp -T to see all available tasks.
Capistrano comes setup and ready to go with this project to make deployment as straightforward as possible. Just run:
$ bundle install
Next, follow the guides to setting up a deployment user and the initial directory on http://capistranorb.com/. Then,
:repo_url settings in
config/deploy.rb and create a stage file in
production.rb file is there as an example for you to start with).
After that you can deploy your site with a single command:
$ bundle exec cap [stage] deploy
Note: You'll need to setup your database separately after your first deployment.
By default, your
master branch will be deployed, but you can deploy a different branch for testing by setting the
BRANCH environment variable, like:
$ BRANCH=cool-new-feature bundle exec cap [stage] deploy
MIT © 3ev