Create a child theme
Set up a child theme for Highend, enqueue styles correctly, and override templates safely.
A child theme keeps your customizations in their own folder, so a Highend update never overwrites your code. Use it for custom CSS, PHP functions, and template overrides instead of editing the parent theme directly.
Folder structure
Create a new folder in wp-content/themes/ with at least a style.css and functions.php:
The style.css header
The header comment at the top of style.css is what tells WordPress this is a child theme, and which parent theme it attaches to:
/*
Theme Name: Highend Child
Theme URI: https://example.com/
Description: Child theme for Highend
Author: Your Name
Author URI: https://example.com/
Template: HighendWP
Version: 1.0.0
Text Domain: highend-child
*/Template: isn't the theme's display name. It's the parent theme's folder name inside wp-content/themes/. Highend is distributed as HighendWP.zip, which unpacks into a folder named HighendWP (confirmed from the theme's build script), so Template: HighendWP is correct for a standard install. If you ever renamed the parent theme's folder after installing it, use that folder name instead. Check AppearanceThemes or the folder name directly on the server if you're unsure.
Highend's own text domain is hbthemes (see the Text Domain: line in the parent's style.css). Give your child theme its own text domain (like highend-child above) for any new strings you add. Don't reuse hbthemes unless you're specifically overriding Highend's own translations (see Translating a child theme).
Enqueue parent and child styles
Highend enqueues its own compiled style.css like this, in includes/core/class-highend-enqueue-scripts.php:
wp_enqueue_style(
'highend-style',
get_parent_theme_file_uri() . '/style.css',
false,
HIGHEND_VERSION,
'all'
);Two things matter here for a child theme:
- It uses
get_parent_theme_file_uri(), so Highend's own stylesheet always loads correctly whether or not a child theme is active. You don't need to re-enqueue it yourself. - Highend does not automatically enqueue a child theme's
style.css. You have to enqueue it yourself in your child theme'sfunctions.php, usingget_stylesheet_directory_uri()(the child theme's own URL) and depending on thehighend-stylehandle so it always loads after the parent's:
add_action( 'wp_enqueue_scripts', 'highend_child_enqueue_styles', 20 );
function highend_child_enqueue_styles() {
wp_enqueue_style(
'highend-child-style',
get_stylesheet_directory_uri() . '/style.css',
array( 'highend-style' ),
wp_get_theme()->get( 'Version' )
);
}The priority 20 (or hooking highend_enqueue_scripts, which Highend fires at the end of its own enqueue routine) just makes sure your call runs after the parent's. The array( 'highend-style' ) dependency is what actually guarantees load order, since WordPress prints styles by resolving dependencies rather than call order.
If you'd rather write plain CSS without relying on the cascade, @import isn't recommended (it blocks rendering); enqueueing as a dependent stylesheet, as above, is the standard approach.
Add your own functions
Your child theme's functions.php runs in addition to (not instead of) the parent's. WordPress loads the child theme's functions.php first, then the parent's. Use it to:
- Enqueue additional stylesheets or scripts.
- Hook into Highend's action hooks and filter hooks.
- Redeclare any parent function that's wrapped in
if ( ! function_exists( '...' ) ): define your version in the child theme and the parent's default is skipped. Most of the template tags infunctions/helpers.phpandfunctions/common.phpare written this way.
Override templates
Place a file at the same relative path in your child theme to override it. WordPress checks the child theme first for the standard template hierarchy (header.php, footer.php, page.php, single.php, and so on) and for page-templates/*.php. Most files under template-parts/ follow the same rule, since Highend loads them with get_template_part(), which also checks the child theme first.
A handful of files are loaded with a hard-coded parent-theme path and can't be overridden this way. Read Templates before you start copying files, so you don't spend time on an override that silently won't load.
Translating a child theme
Highend's own bundled translations live in the parent theme's /languages folder as {locale}.mo files (for example de_DE.mo), the naming WordPress expects for a theme's own bundled catalog. To add a translation or override an existing one without touching the theme at all, drop a domain-prefixed hbthemes-{locale}.mo file (for example hbthemes-de_DE.mo) into wp-content/languages/themes/ instead. WordPress checks that location before the theme's bundled files, for both parent and child themes, and it survives theme updates. See WordPress's own guide to custom translations for the general mechanism.
If your child theme introduces its own new strings (translated under its own text domain, like highend-child above), load them the standard WordPress way:
add_action( 'after_setup_theme', 'highend_child_load_textdomain' );
function highend_child_load_textdomain() {
load_child_theme_textdomain( 'highend-child', get_stylesheet_directory() . '/languages' );
}