Developer Guide
Architecture

Theme Architecture

AlonePro is engineered as an official WordPress child theme of Nextora. By taking full advantage of WordPress Full Site Editing (FSE) child-theme standards, AlonePro extends the parent theme cleanly without duplicating underlying engine logic or template mechanics.


The Parent-Child Relationship

In style.css, AlonePro declares its parent theme:

/*
Theme Name:   AlonePro
Theme URI:    https://beplus.agency/alonepro
Description:  Modern Nonprofit & Charity WordPress FSE Child Theme for Nextora
Author:       BePlus
Template:     nextora
Version:      1.0.5
Text Domain:  alonepro
*/

When WordPress detects Template: nextora, it initiates the FSE theme.json cascade:

  1. Nextora's parent theme.json is loaded first, establishing baseline layout widths, core block supports, and base system settings.
  2. AlonePro's child theme.json is merged on top.
  3. If an active Style Variation (styles/*.json) is selected, its settings override the merged configuration.

theme.json Inheritance & Customizations

AlonePro's child theme.json introduces several specialized configurations:

  • 19 Custom Font Families: Declares typography presets including Montserrat, Montserrat Alternates, Hanken Grotesk, Inter, Nunito, and Poppins, mapped to CSS custom variables (--wp--preset--font-family--*).
  • Custom Page Templates: Registers page-container ("Page — Container") under customTemplates, enabling centered container page layouts with standardized side padding.
  • Template Parts: Registers specialized header and footer parts (header-v2, footer-4-columns, footer-4-columns-newsletter).
  • Modular Color System: Root theme.json deliberately avoids hardcoded theme colors; all palettes are defined in individual styles/*.json files to allow seamless switching across 13 styles.

Block Auto-Discovery System

AlonePro registers dynamic Gutenberg blocks dynamically via blocks/blocks.php:

// blocks/blocks.php
$block_folders = glob( __DIR__ . '/*', GLOB_ONLYDIR );
 
foreach ( $block_folders as $folder ) {
    if ( file_exists( $folder . '/block.json' ) ) {
        register_block_type( $folder );
    }
}

Every subfolder containing a block.json is automatically registered with WordPress. Each block utilizes a render.php script for dynamic, server-side HTML rendering.


Asset Enqueueing Lifecycle

AlonePro enqueues compiled Tailwind CSS styles with priority 25 on both wp_enqueue_scripts and enqueue_block_assets:

function alonepro_enqueue_styles() {
    // Parent stylesheet is loaded first by Nextora
    wp_enqueue_style(
        'alonepro-style',
        get_stylesheet_directory_uri() . '/assets/css/style.css',
        [ 'nextora-style' ],
        wp_get_theme()->get( 'Version' )
    );
}
add_action( 'wp_enqueue_scripts', 'alonepro_enqueue_styles', 25 );
add_action( 'enqueue_block_assets', 'alonepro_enqueue_styles', 25 );

Priority 25 ensures that child theme utility classes, custom properties, and style variation overrides reliably cascade after Nextora's core parent CSS.