Theme integration
Any theme can show Hype5 Theater content. Choose the lightest level of integration that gives you the result you want; each level keeps the plugin's visibility rules intact.
On this page
Levels of integration
| Level | What you do | Good for |
|---|---|---|
| 1. Nothing | Activate the plugin. Its pages render with its own templates inside your theme's header and footer. | Any theme, quickly. |
| 2. Settings | Turn on clean single templates, choose a style mode (Hype5, Hybrid, Minimal) and set colours in the Appearance studio. | Matching your theme without code. |
| 3. Tokens and CSS | Set --hype5-* design tokens and scoped styles in your theme. |
Brand colours, radii, spacing and type. |
| 4. Template overrides | Copy plugin templates into your-theme/hype5-theater/ and change the markup. |
Structural changes to cards, heroes, casts, schedules. |
| 5. Full integration | Call presentation services for your own home page, menus or landing pages; add data with view filters. | A dedicated theatre theme — see Hype5 Stage. |
Level 2: settings
- Clean single templates (Settings → Content) render productions, people and venues with the plugin's own single template instead of your theme's single-post layout. A theme that wants to keep its own single templates — while still printing the plugin's composition — returns
truefromhype5t_use_theme_single_template:
add_filter( 'hype5t_use_theme_single_template', '__return_true' );
- Style mode: Hype5 (full styling), Hybrid (inherits more of the theme's typography and colour) or Minimal (functional layout and focus styles only).
Level 3: tokens and CSS
Hype5 output is wrapped in a .hype5 root. Tokens are output with zero specificity, so a theme can set any of them:
.hype5 {
--hype5-primary: #713e68;
--hype5-border: #d8ced6;
--hype5-radius-md: 4px;
}
Scope component styles to .hype5 and use the stable component classes. See CSS and design tokens.
Level 4: template overrides
- Copy a public template, for example
hype5-theater/templates/production/meta.php, toyour-theme/hype5-theater/production/meta.php(a child theme wins over its parent). - Keep the
@versionheader and edit the markup. Templates receive only$viewand$display. - After each plugin update, check System Status: overrides are reported as Current, Review recommended (outdated) or Missing or malformed version. A major version change means the view data changed incompatibly.
- In a
production.performanceoverride, output nothing when$view['withheld']is set.
See Template overrides for the registry of public templates and their data.
Level 5: full integration
For your own home page or menus, use the stable presentation services: ProductionQuery, ScheduleQuery, ProductionSchedule::row(), ProductionCard::batch(), Labels::get(), DisplayOptions::for_entity(). Link to collections with their built-in addresses — the plugin redirects them to the chosen collection pages:
$productions = get_post_type_archive_link( 'hype5t_production' );
$people = get_post_type_archive_link( 'hype5t_person' );
$schedule = home_url( '/?hype5_collection=schedule' );
Add your own prepared fields with view filters rather than computing them in templates:
add_filter( 'hype5/theater/view/production', function ( array $view, array $display ): array {
if ( ( $view['component'] ?? '' ) === 'production.hero' ) {
$view['my_theme'] = [ 'subtitle' => get_post_meta( (int) $view['id'], 'my_subtitle', true ) ];
}
return $view;
}, 10, 2 );
Rules for theme authors
- Prefer shortcodes, blocks and template overrides — they apply every visibility rule.
- Never print a raw schedule row or a
WP_Postfrom a query service; format them withProductionSchedule::row()andProductionCard::batch()and skipwithheldviews. - For lists that combine several productions, apply the public to everyone rule: a production is shown only while it is published without a password in its original and its reader's-language version.
- Never build purchase links; use
offers[].purchase. - Wrap direct calls so that a missing plugin or a changed internal service cannot break the theme: check
HYPE5_THEATER_VERSIONand catch exceptions. - Do not write the plugin's options, meta or tables, and do not change its Appearance settings from the theme.
Hype5 Stage as an example
Hype5 Stage follows this guide:
- a version gate (
HYPE5_THEATER_VERSION≥ 0.6.17, the production post type and the plugin's renderer class exist), which a site can switch off with thehype5_stage_theater_enhancementsfilter; - a wrapper around every call that falls back to the plain theme on any error;
- overrides in
hype5-stage/hype5-theater/with matching version headers, and ahype5/theater/template/locatedfilter that falls back to the plugin's template when the plugin's template has a newer major version or in the administration; - view filters that add fields under a
stagekey and never remove any; - the plugin's stylesheets in a CSS cascade layer, so the theme's component styles win without specificity contests while the site's Hype5 custom CSS still wins last.
Stage also reads some section settings and uses a few services that the plugin classifies as internal; those are documented risks, not a pattern to copy. See Hype5 Theater integration and Presentation services.