๐Ÿ“– Lesson 10 of 13

WP Rig for Child Theming

WP Rig is an exceptional starter boilerplate for parent themes, but it is also fully optimized for **Child Theme Development**.

In this lesson, you will learn how to leverage the automated `childify` command to create lightweight child themes that inherit parent functionality while keeping WP Rig’s high-efficiency build pipeline!


1. What is WP Rig "Childification"?

In standard WordPress setups, developing a child theme manually means setting up a new folder, writing a `style.css` header referencing the parent, and enqueuing parent styles in PHP. While simple, you lose access to modern CSS, Javascript, and block compilers for your custom child styles.

WP Rig resolves this by incorporating a dedicated **childify** script.

When you run childify, WP Rig: * Converts your active development workspace into an optimized child theme configuration. * Enforces template inheritance in `functions.php`. * Keeps all source folders (`assets/css/src/`, `assets/js/src/`) and **compiler setups (Bun / Lightning CSS)** active locally.

This allows you to write optimized CSS/JS on top of any parent theme (like Twenty Twenty-Five) while letting WP Rig build, compile, and bundle your child theme files dynamically!


2. Running the Childify Script

To convert your WP Rig theme into a lightweight child theme, execute the following steps in your terminal:

1. Set the Parent Theme Variable

{
  "theme": {
    "parent": "twentytwentyfive"
  }
}

2. Run the Command

3. Review the Script Execution


3. Developing inside a Child Theme

Once childified: 1. **Write Styles Globally:** Add custom styles to `assets/css/src/global.css` or specific block style overrides. 2. **Run Dev Compilers:** Run `npm run dev` to watch child changes and inject them into your local browser window. 3. **Bundle child Theme:** When ready for production deployment, run `npm run bundle` to output an optimized, directory-ready child theme zip archive!