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.
Download the Lumberjack Bedrock Installer with Composer (you only need to do this the first time):
composer global require rareloop/lumberjack-bedrock-installer
Make sure that Composer's global
vendorbin directory is in your
$PATHso that the installer can be used.
Once the installer is available on your computer you can create a new Lumberjack/Bedrock site using:
lumberjack-bedrock new my-site
This will create a new folder
my-sitein the current working directory, install the latest version of Bedrock, add the
lumberjack-coredependency and download the most recent Lumberjack starter theme.
To complete the install do the following:
- 1.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 (
- 2.Set your site vhost document root to
- 3.Access WP admin at
http://example.com/adminand activate the Lumberjack theme.
If you don't plan to use Bedrock and have another Composer based setup for WordPress, you can do the following:
- 2.Now add the Lumberjack Core dependency via Composer:composer require rareloop/lumberjack-core
- 3.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
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.
- 1.Add the Lumberjack Core dependency via Composer:composer require rareloop/lumberjack-core
- 2.Copy the following directories from the Lumberjack Starter Theme into your theme:
- 3.Create an empty
routes.phpfile at the root of your theme directory.
- 4.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 filerequire_once('routes.php');// Set global params in the Timber contextadd_filter('timber_context', [$lumberjack, 'addToContext']);
- 5.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