Developers
Hooks, filters, template structure and CSS variables for customising ProMax and ProMax Pro from a child theme or plugin.
ProMax uses the prefix promax_ and text domain promax. ProMax Pro uses promaxpro_ and promaxpro. Unless noted, every hook and filter below exists in both editions with the matching prefix.
File structure
functions.php Loads the files in /inc
style.css Main stylesheet (CSS variables at the top)
theme.json Editor palette, font sizes, content widths
header.php, footer.php, index.php, archive.php, search.php,
single.php, page.php, 404.php, sidebar.php, comments.php, woocommerce.php
inc/ setup, enqueue, widgets, template tags and functions,
colour schemes, post layouts, WooCommerce, Customizer
template-parts/
header/ top-nav.php, main-nav.php
content/ card.php, single.php, page.php, none.php
sidebar/ popular-posts.php
footer/ widgets.php, site-info.php
latest-strip.php
assets/ CSS, JS, fonts
languages/ .pot and translations
To change a template, copy it into the same path in a child theme. The post card used by every layout is template-parts/content/card.php; it receives $args['layout'] and $args['index'].
Action hooks
| Hook | Where | Used by the theme for |
|---|---|---|
promax_below_navigation Freepromaxpro_before_content Pro | Below the menus, before the content | Latest posts strip |
promaxpro_before_post_index Pro | Above the post list on the blog home page | Slider |
promaxpro_before_archive_page, promaxpro_after_archive_page Pro | Before and after archive listings | Breadcrumbs, archive title |
promaxpro_single_before_content, promaxpro_page_before_content Pro | Before the post or page | Breadcrumbs |
promax_thumbnail_bottom | Inside each card's image area | Date and author stamp |
promax_after_single_post | Footer of single posts | Author box; Pro: share buttons (priority 5) |
promax_after_single_page | End of pages | Free: author box; Pro: share buttons |
promaxpro_before_footer Pro | Above the footer | — |
// Add a newsletter box below every post.
add_action( 'promax_after_single_post', function () {
echo '<div class="my-newsletter">…</div>';
}, 20 );
// Remove the author box.
add_action( 'after_setup_theme', function () {
remove_action( 'promax_after_single_post', 'promax_author_profile' );
} );
Filters
| Filter | Filters |
|---|---|
promax_breadcrumbs | The breadcrumb trail: array of [ url, label ] |
promax_breadcrumb_schema | Whether breadcrumbs carry BreadcrumbList markup (bool) |
promax_seo_plugin_breadcrumbs | Breadcrumb HTML from an SEO plugin; empty string uses the theme's |
promax_hentry | Whether a post keeps the hentry class (bool, post ID) |
promax_has_sidebar | Whether the sidebar column shows (bool) |
promaxpro_layout Pro | The current page layout: right, left or full |
promax_card_excerpt_length | Card excerpt length in words (Free: 25; Pro: the Customizer value) |
promax_post_grid_classes | CSS classes on the post list wrapper (array, layout) |
promaxpro_post_layouts Pro | The list of post layouts |
promax_color_schemes | The colour schemes and their CSS variable values; add your own scheme here |
promax_dynamic_css | The CSS generated from Customizer settings |
promax_latest_posts_args, promax_popular_posts_args | WP_Query arguments for the latest posts strip and Popular Posts |
promaxpro_ticker_args Pro | WP_Query arguments for the news ticker |
promax_social_networks, promax_social_slots | Available social networks; number of icon slots (Free 7, Pro 19) |
promax_icons | The inline SVG icon set |
promaxpro_share_networks Pro | Share buttons: label, icon and share URL pattern |
promaxpro_google_fonts Pro | Fonts offered in the Customizer |
promax_content_width | Content width for embeds (default 800) |
promax_custom_header_args, promax_custom_logo_args, promax_custom_background_args | Arguments for the WordPress header image, logo and background features |
promaxpro_update_metadata_url Pro | URL of the update information file |
// Popular Posts: most commented posts from the last 30 days only.
add_filter( 'promax_popular_posts_args', function ( $args ) {
$args['date_query'] = array( array( 'after' => '30 days ago' ) );
return $args;
} );
// Longer card excerpts in the free theme.
add_filter( 'promax_card_excerpt_length', function () {
return 40;
} );
Pluggable functions
These template tags are wrapped in function_exists(), so a child theme can replace them by defining a function with the same name in its functions.php:
promax_site_logo, promax_site_title, promax_site_description, promax_post_meta, promax_meta_date, promax_meta_author, promax_post_image, promax_card_categories, promax_thumbnail_bottom_date_author, promax_breadcrumbs, promax_pagenavi, promax_post_navigation, promax_entry_tags, promax_author_profile, promax_socialprofiles, promax_latets_posts, promax_floating_cart, promax_header_style (and Pro's promaxpro_socialshare).
CSS variables
Colours, widths and radii are CSS custom properties on :root. Colour schemes and Customizer colours set them; you can too, in Customize › Additional CSS:
:root {
--pm-accent: #0b7a75; /* heading bars, highlights */
--pm-badge: #b45309; /* category badges */
--pm-radius: 0; /* square corners */
}
| Variable | Controls |
|---|---|
--pm-container | Maximum content width (Website width setting) |
--pm-text, --pm-text-muted, --pm-heading | Body text, secondary text, headings |
--pm-bg, --pm-surface, --pm-border, --pm-card-bg | Page background, soft panels, borders, cards |
--pm-header-bg, --pm-header-text | Header |
--pm-topnav-bg, --pm-topnav-text | Top navigation bar |
--pm-mainnav-bg, --pm-mainnav-text, --pm-mainnav-hover | Main navigation bar |
--pm-accent, --pm-badge | Heading bars and highlights; category badges |
--pm-link, --pm-link-hover, --pm-button | Links and buttons |
--pm-widget-title-bg, --pm-widget-title-text | Sidebar widget titles |
--pm-footer-bg, --pm-footer-text, --pm-footer-link, --pm-bottom-bg | Footer and copyright bar |
--pm-radius, --pm-shadow | Corner radius and card shadow |
The body has a color-scheme-{name} class (for example color-scheme-green), so CSS can target one scheme. The block editor palette uses the slugs accent, primary, link, badge, dark, heading, text, muted, surface and white.
Useful body classes
has-sidebar/no-sidebar— whether the sidebar column shows.cards-fixed/cards-auto— equal-height or fit-content cards.pm-shop-page— any WooCommerce page.- Pro
layout-right,layout-left,layout-full— the current page layout.
Block editor
- Editor styles match the front end, including the chosen colour scheme.
- Block styles: Card for the Group block and Section bar for the Heading block.
- Patterns: Call to action card and Section with latest posts.
Translations
The languages folder has a .pot template. Translate with Loco Translate or Poedit. The free theme also receives translations from translate.wordpress.org. Right-to-left languages get a dedicated stylesheet automatically.
Image sizes
Cards use promax-card (720×480, cropped). Pro's Classic blog and Featured hero use large, Masonry uses medium_large, and Compact list uses thumbnail.