This project contains WordPress themes and a set of plugins for the Carnegie Museum of Art. The themes are based on the Sage starter theme.
Theme development requires node, Bower, Gulp, and WordPress premium plugins Advanced Custom Fields and WP Migrate DB Pro. These plugins and their license keys must be installed independently.
This project also requires Docker. In this instance Docker, along with the provided Docker containers, will simplify local WordPress theme development by including the essential software for running this system on your local machine. This software includes Nginx, PHP, WordPress Core, and WP CLI.
While this project should run on any local system, the following instructions will assume you have installed Docker for Mac and Docker Toolbox. If you have not already installed Docker on your system you should do so before continuing.
Review the contents of docker-compose.yml
to get familiar with the configuration and settings including phpMyAdmin, Docker containers, and others.
-
Clone this repository into the local project folder.
-
Configure the local server with settings detailed in the sample config. Copy/paste contents of
wp-config-sample.php
to a new filewp-config.php
. -
Restart the Docker app on the local machine.
-
Pull down and run the Docker containers for this project:
docker-compose up -d
About these libs... From the root project directory:
-
Install Composer.
-
Install Composer packages:
php composer.phar install
-
A folder labeled
vendor
should be visible in the root project directory. -
Install premium plugins, Advanced Custom Fields and WP Migrate DB Pro to
wp-content/plugins/
Node, npm, Bower, and Gulp are required for CMOA-2016 theme development. Each tool plays a roll in the development workflow. These tools are subject to change as better, simpler, tooling becomes available.
-
Update or install node and npm on the local machine.
-
Update or install Gulp and Bower globally:
npm install -g Gulp-cli
npm install -g bower
-
Install all other dependencies local to the project. From within the theme directory install:
npm install
bower install
Gulp automates the build process by running repetitive tasks from a few simple commands. The tasks are detailed in gulpfile.js at the root of each theme.
With Browsersync enabled, static assets will be recompiled/bundled when saved and your browser will automatically reload.
-
Compile assets. From within the theme directory run:
gulp
These are the compiled assets that will be transferred from local development to staging or production.
-
Compile assets for production and update the asset manifest. From within the theme directory run:
gulp production
- Visit
http://localhost
in your browser and follow the steps to set up a new WordPress site. This setup is temporary and will be overwritten when the database is synced. - For Multi-site installs, follow the steps in the WordPress documentation to set up your network locally. Note, do not add the port number to the domain e.g.
define('DOMAIN_CURRENT_SITE', 'localhost');
. - Add license keys to Advanced Custom Fields and WP Migrate DB Pro plugins. Activate plugins.
- Sync the production database to your local database with WP Migrate DB Pro plugin. Choose "Pull"...
Things happen. A step is missed and the whole workflow is not so much a “flow” but more like a wall. Here’s a list of common mistakes, and remedies, to help get that workflow flowing again.
- Stuck in and endless WordPress install loop?
- Was Composer installed correctly? After downloading Composer, be sure to run
php composer.phar install
.
- Was Composer installed correctly? After downloading Composer, be sure to run
- Plugins that need to be set up:
- ElasticPress
- Tenon API key
- Detail steps for Multi-site installation
- Update the Docker container to use Apachie over Nginx
- More typical for WordPress installs and .htaccess readwrite rules