Lumberjack
WebsiteRareloopTimber DocumentationTwig Documentation
v6
v6
  • Introduction
  • What's New
  • Upgrade Guide
  • Getting Started
    • Installation
    • Configuration
  • The Basics
    • Lifecycle
    • Routing
    • WordPress Controllers
    • Post Types
    • Query Builder
    • View Models
    • HTTP Requests
    • HTTP Responses
    • Middleware
    • Sessions
    • Helpers
    • Collections
  • Container
    • Using the Container
    • Service Providers
    • Facades
  • Misc
    • Contributing
    • Notable Mentions
    • Code of Conduct
    • View on GitHub
    • View Docs on GitHub
    • Submit an issue
Powered by GitBook
On this page
  • Requirements
  • Using the Installer (Recommended)
  • Pre-requisites
  • Create a new site
  • Additional Options
  • Manual Installation
  • Add to existing theme
  1. Getting Started

Installation

PreviousUpgrade GuideNextConfiguration

Last updated 2 years ago

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 . 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-installer

Make 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-site

This 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:

  1. Edit the .env file 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)

  2. Set your site vhost document root to /path/to/my-site/web/

  3. Access WP admin at http://example.com/admin and activate the Lumberjack theme.

Additional Options

Manual Installation

If you don't plan to use Bedrock and have another Composer based setup for WordPress, you can do the following:

  1. Now add the Lumberjack Core dependency via Composer:

     composer require rareloop/lumberjack-core
  2. If your setup doesn't include your Composer vendor/autoload.php file 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.

  1. Add the Lumberjack Core dependency via Composer:

     composer require rareloop/lumberjack-core
    • app

    • bootstrap

    • config

    • views

  2. Create an empty routes.php file at the root of your theme directory.

  3. Add the following to the top of your functions.php file:

     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']);
  4. If your setup doesn't include your Composer vendor/autoload.php file 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');

WP_HOME - Full URL to WordPress home (e.g. )

WP_SITEURL - Full URL to WordPress including subdirectory (e.g. )

AUTH_KEY, SECURE_AUTH_KEY, LOGGED_IN_KEY, NONCE_KEY, AUTH_SALT, SECURE_AUTH_SALT, LOGGED_IN_SALT, NONCE_SALT - Generate with or from the

For more information on additional installer options, please see the package on GitHub.

Download the and add it to your WordPress theme directory.

Copy the following directories from the into your theme:

Composer
Bedrock
http://example.com
http://example.com/wp
wp-cli-dotenv-command
Roots WordPress Salt Generator
Lumberjack Installer
Lumberjack Starter Theme
Lumberjack Starter Theme