Overview

How Highend's codebase is put together, and the supported ways to extend or customize it.

This section is for PHP/WordPress developers extending Highend: building a child theme, hooking into the theme's actions and filters, overriding templates, or reading theme option values from custom code. It assumes you're comfortable with WordPress theme development.

Highend is a standard WordPress theme (not a framework or a plugin-dependent system). It's distributed as a .zip you install through AppearanceThemesAdd New Theme, not run from a Git repository on a live site.

Architecture at a glance

Everything boots from functions.php, which defines a singleton Highend class. On first access it runs, in order:

  1. constants() defines the path/URI constants listed below.
  2. includes() loads the theme's PHP files: functions/*.php helpers, hbframework/hbframework.php (the bundled admin framework), the core classes in includes/core/, options-framework/bootstrap.php (the theme options and metabox engine), compatibility shims, the portfolio and gallery modules, includes/shortcodes.php, and, only when is_admin(), the admin-only classes.
  3. objects() instantiates Highend_Options, Highend_Customizer, and (in admin) Highend_Admin.

After that, the theme fires the highend_loaded action so other code can safely assume the theme is fully initialized. Grab the singleton anywhere with the highend() function, for example highend()->version.

functions.php
function highend() {
	return Highend::instance();
}

Folder structure

FolderWhat's in it
functions/Procedural helper functions: option/meta getters, template tags, breadcrumbs, likes, dynamic CSS generation. Loaded directly by functions.php.
includes/core/Theme setup (post types, taxonomies, nav menus, sidebars), enqueueing, install/update routines, and the Highend_Options class.
includes/customizer/Customizer panel/section/control registration.
includes/portfolio/, includes/gallery/The Portfolio and Gallery modules: each registers its own post type, taxonomy, and shortcodes.
includes/widgets/Bundled widgets (latest posts, social icons, maps, and so on).
includes/shortcodes.phpAll WPBakery/shortcode definitions (vc_map() calls) and their render callbacks.
hbframework/The admin framework: About page, demo importer, plugin installer, icon manager, nav menu walker. Mostly backend tooling, not something you hook into for front-end work.
options-framework/The bundled options/metabox engine (a customized Vafpress-based framework) that powers the Highend Options panel and per-page metaboxes. Exposes vp_option() and vp_metabox(). See Functions & constants.
admin/Highend's own admin screens and metabox registration (admin/metabox/class-metabox.php registers the per-post-type metabox groups you read with vp_metabox()).
template-parts/Reusable partials (header, footer, entry loop, single content, and so on) loaded with get_template_part(). See Templates for which ones you can override.
page-templates/Selectable WordPress page templates (Blog, Contact, Gallery, Portfolio, and so on). Each has a Template Name: header.

Constants

Defined once in functions.php → constants(), always available after the theme loads:

Prop

Type

These constants always point at the parent theme

HIGHEND_THEME_PATH, HBTHEMES_ROOT, and friends resolve with get_template_directory() / get_parent_theme_file_path(). They point at the parent theme's folder even when a child theme is active. Any file loaded through one of these constants (a raw include/require) can't be overridden from a child theme. See Templates for exactly which files that affects.

Customize safely

  • Use a child theme for your own CSS, template overrides, and functions. Never edit the parent theme's files directly. Highend ships as a packaged .zip; an update replaces the entire parent theme folder, so direct edits are lost on the next update. See Create a child theme.
  • Hook instead of editing core files. Highend fires action hooks around every major template region (header, footer, loop, single content, and more) and filters on most computed values (classes, layout, option values, query args). See Action hooks and Filter hooks.
  • Override templates from a child theme where the theme supports it. Most template-parts/*.php files are loaded with get_template_part() and can be overridden by placing a file at the same relative path in your child theme. Root template files (header.php, single.php, page.php, and so on) and page-templates/*.php follow WordPress's normal template hierarchy. Read Templates first. A few files are loaded with a hard-coded parent-theme path and can't be overridden this way.
  • Read options and page meta through the theme's own getters, highend_option() for Highend Options values and vp_metabox() for per-page/post meta, rather than querying wp_options/post meta directly. See Functions & constants.
  • Many if ( ! function_exists( ... ) )-wrapped functions in functions/*.php can be fully redeclared in your child theme's functions.php, as long as your child theme's file loads first (WordPress always loads the child theme's functions.php before the parent's).

On this page