Skip to content

Build on Reign with a child theme

Reign Theme overviewPremiumGet Reign Theme →

A child theme keeps your own code safe when Reign updates. Any file you edit inside reign-theme is overwritten on the next update, with no warning. A child theme is a separate folder that loads on top of Reign, so your changes stay.

Your Customizer and Reign Settings choices are safe either way. They live in the database, not in theme files. A child theme is for template edits, custom PHP and anything else you would put inside reign-theme.

Go to Reign Settings > Tools. The Child theme card has a Download child theme button. It downloads reign-child-theme.zip, the latest official child theme, ready to upload. You can also get it from the child theme’s GitHub releases. It is a starter package, not a copy of your current site. Your existing settings already live safely in the database.

The package holds four files:

File What it is for
style.css The theme header, and the place for your custom CSS
functions.php Loads your CSS in the right order, keeps settings in step, and has a marked spot for your PHP
readme.txt Version, requirements and changelog
screenshot.png The image shown under Appearance > Themes

The same Tools screen has a System status card. It reports your PHP, WordPress and Reign versions and whether a child theme is active. Copy it into a support ticket when you open one.

  1. Upload the downloaded zip via Appearance > Themes > Add New > Upload Theme, then activate it.
  2. WordPress takes you to Reign Settings. Your Customizer and Reign Settings choices are copied into the child theme. The site looks exactly as before, and nothing is reset.
  3. Confirm it worked. On Reign Settings > Home, the Child theme step now reads “Your code changes survive updates”. Reign Settings > Tools shows Child theme: Yes.

Keep the name “REIGN Child”. Reign finds the official child theme by the Theme Name: REIGN Child line in its style.css. It copies your settings across only when that name matches. If you rename the child theme, try it on a staging copy first and check your settings.

Changes you make in the Customizer while the child theme is active are also saved back to Reign. Switching between the two themes never loses them.

Put your CSS at the end of the child theme’s style.css. The official child theme loads that file after all of Reign’s stylesheets. A rule of yours wins over Reign’s when both are equally specific. Edits show up straight away, because the file’s version follows its last change.

For a few quick rules you can use Appearance > Customize > Additional CSS instead.

Reign ships two variables for each status. Your messages then follow light and dark mode and stay readable.

Status Fill, border or tint Text
Success --reign-color-success --reign-color-success-text
Error --reign-color-error --reign-color-error-text
Warning --reign-color-warning --reign-color-warning-text
Info --reign-color-info --reign-color-info-text

Use the fill colour for backgrounds, borders and icons, and the -text variable for words. The fill colours are bright and fail contrast as text. The -text variables reach 4.5:1 on Reign’s surfaces in both modes.

.my-notice--success {
background: color-mix(in srgb, var(--reign-color-success) 12%, var(--reign-site-sections-bg-color));
border: 1px solid var(--reign-color-success);
color: var(--reign-color-success-text);
}

If you write a child theme from scratch, load its stylesheet the same way. Reign queues its main stylesheet, reign_main_style, late (priority 5001). Queue yours after it and depend on it. Otherwise Reign’s rules can override yours.

add_action( 'wp_enqueue_scripts', 'my_child_enqueue_styles', 6000 );
function my_child_enqueue_styles() {
wp_enqueue_style( 'my-child-style', get_stylesheet_uri(), array( 'reign_main_style' ), wp_get_theme()->get( 'Version' ) );
}

Child themes written for Reign 8.0.8 or earlier may depend on reign-critical. That handle still exists as an alias of the main stylesheet, so they keep working.

Your child theme’s style.css needs the standard WordPress child theme header. It must include a Template: reign-theme line that matches Reign’s folder name.

  • Template overrides. See template overrides for the directory rules, including the one BuddyPress-specific exception.
  • Custom PHP: new hook callbacks, filters, shortcodes. Add it at the end of functions.php, below the marked line. Common changes has tested snippets to start from.
  • CSS beyond a handful of rules, or CSS you want under version control.

Customize > General > Custom Code has three fields: Tracking Code, Custom JS: Header and Custom JS: Footer. Tracking Code is added to the site header, for things like analytics or a Facebook Pixel. Use these fields for small, site-wide snippets. They need no file editing and no child theme. A site owner who is not a developer can find and edit them later.

If a snippet grows into real logic or more than a few lines, move it into the child theme. That keeps Custom Code for small snippets. Anything bigger then sits in a file you can put under version control.

Reign keeps these functions for child theme templates, even where its own templates no longer call them. Each is wrapped in function_exists(). A child theme can replace one by defining a function with the same name.

Function Prints
reign_posted_on() The post date and author line
reign_entry_footer() Categories, tags, the comments link and the edit link for a post
reign_categorized_blog() Returns true when the site uses more than one category (used by reign_entry_footer())

Once your child theme is active, the hooks reference and the REST API cover the extension points available to code running in it.