Initializing WP Rig and Dependency Setup

With your system runtimes and local WordPress site online, we can begin setting up WP Rig. In this lesson, you will learn how to download WP Rig, configure its setup variables, and run the initialization compilers.


1. Clones the Repository

First, navigate to your local site’s themes folder (e.g., `wp-content/themes/`) and clone the official repository:

“`bash cd wp-content/themes/ git clone https://github.com/wprig/wprig.git wprig cd wprig “` > **Important:** Keep the theme folder named `wprig` or `wprig-dev` during active development. When you eventually bundle the theme for production, WP Rig’s compiler will automatically package your code into a new, clean production directory matching your custom slug.


2. Setting Your Custom Properties

WP Rig is highly customizable. Before installing packages, you can specify your custom theme name, slug, author details, and local development URL.

The Layered JSON Configuration

{
  "theme": {
    "slug": "excalibur",
    "name": "Excalibur Theme",
    "author": "My Web Studio"
  }
}

If you are running a custom local URL (such as `excalibur.local` or `localhost:8888`), create `config.local.json` which is ignored in Git:

{
  "dev": {
    "browserSync": {
      "proxyURL": "localhost:8885"
    }
  }
}

3. Running `rig-init` & Answering Prompts

With your configurations written, run the initialization command. This task installs all compiler libraries, fetches PHP Composer dependencies, and sets up your environment variables:

Option A: Standard npm Setup

Option B: Blazing-Fast Bun Setup (Recommended)

During initialization, the CLI will present a series of questions: 1. **Confirm Theme Details:** It displays your customized theme slug (`excalibur`), name (`Excalibur Theme`), and author. Confirm that they are correct. 2. **BrowserSync Proxy Setup:** Enter your local URL (e.g. `https://wprig.io/`). The installer uses this URL to proxy and sync live-preview events. 3. **Local SSL Certificates:** If your local site is running under HTTPS, WP Rig will offer to generate self-signed trust certificates locally to avoid browser warnings.

Once completed, the terminal will confirm that all dependencies are installed and the configuration indexes are locked. In our next lesson, we will compile your assets, activate the theme, and run the automated database setup!

Sections:

Building, Activating, and Running dev_setup via WP-CLI

With dependencies locked, you are ready to compile the theme, activate it in WordPress, and execute the automated `dev_setup` command via WP-CLI.

In this lesson, you will learn how to trigger the compiler, perform theme activation, and establish essential development structures.


1. Run the Build Command

First, run the initial compiler script. This parses source files in `src/` (CSS, JS, images, fonts) and processes them into ready development artifacts in `assets/`:

“`bash npm run build “` This script compiles styles with Autoprefixer and nesting, minifies JavaScript files, processes icons, and prepares standard development assets.


2. Activate the Theme

With the theme compiled, you can activate it. You can do this by navigating to your WordPress dashboard (`Appearance → Themes` and click *Activate*), or use **WP-CLI** (highly recommended for speed):

Using WordPress Studio CLI

Using LocalWP or Native WP-CLI

Verify that the theme is active by running: “`bash studio wp theme list –status=active “`


3. Run the `dev_setup` Script

WP Rig comes with a custom, automated setup command that configures your WordPress database for development. Running `dev_setup` automatically: 1. Imports placeholder starter menus and pages. 2. Sets permalinks to beautiful URLs (`/%postname%/`). 3. Establishes dummy categories and demo tags. 4. Configures default settings (reading page settings, deactivating search engines indexes, etc.).

Execute the command from your terminal:

Under WordPress Studio

Under LocalWP or Native WP-CLI

**Key Takeaway:** By running `dev-setup.php` immediately after activation, your local sandbox is instantly populated with structured testing content, saving you hours of clicking and manual configurations!

Now that your theme is active and your sandbox is populated, let’s look at launching your daily workspace and navigating asset directories!

Sections: