Installation
Requirements
- PHP >=7.1 
Currently, using a child-theme to extend a Lumberjack theme is unsupported.
Using the Installer (Recommended)
This is the recommended way to create a new site and assumes you want to build on top of Bedrock. If you're new to using WordPress with Composer this is the simplest (and quickest) way to get up and running as the installer will do all the heavy lifting for you.
Pre-requisites
Download the Lumberjack Bedrock Installer with Composer (you only need to do this the first time):
composer global require rareloop/lumberjack-bedrock-installerMake sure that Composer's global vendor bin directory is in your $PATH so that the installer can be used.
Create a new site
Once the installer is available on your computer you can create a new Lumberjack/Bedrock site using:
lumberjack-bedrock new my-siteThis will create a new folder my-site in the current working directory, install the latest version of Bedrock, add the lumberjack-core dependency and download the most recent Lumberjack starter theme.
To complete the install do the following:
- Edit the - .envfile and update environment variables:- DB_NAME- Database name
- DB_USER- Database user
- DB_PASSWORD- Database password
- DB_HOST- Database host
- WP_ENV- Set to environment (- development,- staging,- production)
- WP_HOME- Full URL to WordPress home (e.g. http://example.com)
- WP_SITEURL- Full URL to WordPress including subdirectory (e.g. http://example.com/wp)
- AUTH_KEY,- SECURE_AUTH_KEY,- LOGGED_IN_KEY,- NONCE_KEY,- AUTH_SALT,- SECURE_AUTH_SALT,- LOGGED_IN_SALT,- NONCE_SALT- Generate with wp-cli-dotenv-command or from the Roots WordPress Salt Generator
 
- Set your site vhost document root to - /path/to/my-site/web/
- Access WP admin at - http://example.com/adminand activate the Lumberjack theme.
Additional Options
For more information on additional installer options, please see the Lumberjack Installer package on GitHub.
Manual Installation
If you don't plan to use Bedrock and have another Composer based setup for WordPress, you can do the following:
- Download the Lumberjack Starter Theme and add it to your WordPress theme directory. 
- Now add the Lumberjack Core dependency via Composer: - composer require rareloop/lumberjack-core
- If your setup doesn't include your Composer - vendor/autoload.phpfile outside of the theme, you'll need to add the following to the top of the themes- functions.php:- require_once('path/to/composer/vendor/autoload.php');
Add to existing theme
Lumberjack can be added to an existing theme as long as Composer is being used as part of your setup. You're able to use as little or as much as you need and the framework will play nicely alongside more traditional WordPress code.
- Add the Lumberjack Core dependency via Composer: - composer require rareloop/lumberjack-core
- Copy the following directories from the Lumberjack Starter Theme into your theme: - app
- bootstrap
- config
- views
 
- Create an empty - routes.phpfile at the root of your theme directory.
- Add the following to the top of your - functions.phpfile:- use App\Http\Lumberjack; // Create the Application Container $app = require_once('bootstrap/app.php'); // Bootstrap Lumberjack from the Container $lumberjack = $app->make(Lumberjack::class); $lumberjack->bootstrap(); // Import our routes file require_once('routes.php'); // Set global params in the Timber context add_filter('timber_context', [$lumberjack, 'addToContext']);
- If your setup doesn't include your Composer - vendor/autoload.phpfile outside of the theme, you'll need to also add the following to the top of the themes- functions.php:- require_once('path/to/composer/vendor/autoload.php');
Last updated
