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:
constants()defines the path/URI constants listed below.includes()loads the theme's PHP files:functions/*.phphelpers,hbframework/hbframework.php(the bundled admin framework), the core classes inincludes/core/,options-framework/bootstrap.php(the theme options and metabox engine), compatibility shims, the portfolio and gallery modules,includes/shortcodes.php, and, only whenis_admin(), the admin-only classes.objects()instantiatesHighend_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.
function highend() {
return Highend::instance();
}Folder structure
| Folder | What'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.php | All 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
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/*.phpfiles are loaded withget_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) andpage-templates/*.phpfollow 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 andvp_metabox()for per-page/post meta, rather than queryingwp_options/post meta directly. See Functions & constants. - Many
if ( ! function_exists( ... ) )-wrapped functions infunctions/*.phpcan be fully redeclared in your child theme'sfunctions.php, as long as your child theme's file loads first (WordPress always loads the child theme'sfunctions.phpbefore the parent's).
Related
Create a child theme
Folder structure, style.css header, and enqueueing parent styles correctly.
Action hooks
Every do_action() call you can hook into, grouped by area.
Filter hooks
Every apply_filters() call you can hook into, grouped by area.
Templates
The template hierarchy and exactly what a child theme can override.
Functions & constants
Public helper functions, option/meta getters, and constants.
Post types & taxonomies
Custom post types, taxonomies, and how to query them.