Developers

Hooks, filters, template structure and CSS variables for customising ProMax and ProMax Pro from a child theme or plugin.

Prefixes

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

HookWhereUsed by the theme for
promax_below_navigation Free
promaxpro_before_content Pro
Below the menus, before the contentLatest posts strip
promaxpro_before_post_index ProAbove the post list on the blog home pageSlider
promaxpro_before_archive_page, promaxpro_after_archive_page ProBefore and after archive listingsBreadcrumbs, archive title
promaxpro_single_before_content, promaxpro_page_before_content ProBefore the post or pageBreadcrumbs
promax_thumbnail_bottomInside each card's image areaDate and author stamp
promax_after_single_postFooter of single postsAuthor box; Pro: share buttons (priority 5)
promax_after_single_pageEnd of pagesFree: author box; Pro: share buttons
promaxpro_before_footer ProAbove 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

FilterFilters
promax_breadcrumbsThe breadcrumb trail: array of [ url, label ]
promax_breadcrumb_schemaWhether breadcrumbs carry BreadcrumbList markup (bool)
promax_seo_plugin_breadcrumbsBreadcrumb HTML from an SEO plugin; empty string uses the theme's
promax_hentryWhether a post keeps the hentry class (bool, post ID)
promax_has_sidebarWhether the sidebar column shows (bool)
promaxpro_layout ProThe current page layout: right, left or full
promax_card_excerpt_lengthCard excerpt length in words (Free: 25; Pro: the Customizer value)
promax_post_grid_classesCSS classes on the post list wrapper (array, layout)
promaxpro_post_layouts ProThe list of post layouts
promax_color_schemesThe colour schemes and their CSS variable values; add your own scheme here
promax_dynamic_cssThe CSS generated from Customizer settings
promax_latest_posts_args, promax_popular_posts_argsWP_Query arguments for the latest posts strip and Popular Posts
promaxpro_ticker_args ProWP_Query arguments for the news ticker
promax_social_networks, promax_social_slotsAvailable social networks; number of icon slots (Free 7, Pro 19)
promax_iconsThe inline SVG icon set
promaxpro_share_networks ProShare buttons: label, icon and share URL pattern
promaxpro_google_fonts ProFonts offered in the Customizer
promax_content_widthContent width for embeds (default 800)
promax_custom_header_args, promax_custom_logo_args, promax_custom_background_argsArguments for the WordPress header image, logo and background features
promaxpro_update_metadata_url ProURL 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 */
}
VariableControls
--pm-containerMaximum content width (Website width setting)
--pm-text, --pm-text-muted, --pm-headingBody text, secondary text, headings
--pm-bg, --pm-surface, --pm-border, --pm-card-bgPage background, soft panels, borders, cards
--pm-header-bg, --pm-header-textHeader
--pm-topnav-bg, --pm-topnav-textTop navigation bar
--pm-mainnav-bg, --pm-mainnav-text, --pm-mainnav-hoverMain navigation bar
--pm-accent, --pm-badgeHeading bars and highlights; category badges
--pm-link, --pm-link-hover, --pm-buttonLinks and buttons
--pm-widget-title-bg, --pm-widget-title-textSidebar widget titles
--pm-footer-bg, --pm-footer-text, --pm-footer-link, --pm-bottom-bgFooter and copyright bar
--pm-radius, --pm-shadowCorner 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.