The Lyquix theme is built on four principles:
- Best practices in HTML, CSS, JavaScript, SEO, accessibility, security, and performance
- Code reuse and consistency for efficiency and reduced errors
- Unopinionated approach allowing fully custom designs without theme interference
- Easy updates without affecting customizations
The theme intentionally ships with minimal default styling. There is no opinionated theme.json, no preset color palettes, and no default page layouts. Everything is yours to define.
The theme uses a strict parent/child architecture:
lyquix/ (Parent Theme - DO NOT MODIFY)
lyquix-child/ (Child Theme - All customizations go here)
The parent theme is the framework. It provides:
- PHP infrastructure (routing, blocks, modules, utilities)
- TypeScript/JavaScript library
- SCSS base files and Tailwind configuration
- ACF field group definitions
- Gutenberg block registrations
- Build tooling configuration
The child theme is the project. It contains:
- All site-specific customizations
- Custom styles (SCSS)
- Custom scripts (TypeScript)
- Template overrides
- Block rendering overrides
- The main HTML template (
custom.php)
Every file in the parent theme is marked with a prominent ASCII art banner:
DO NOT MODIFY THIS FILE!
This is enforced by convention, not by code. The parent theme is designed to be replaced wholesale when updates are released. Any modifications to parent files will be lost on update.
All customization is channeled through well-defined extension points in the child theme:
| Extension Point | Location | Purpose |
|---|---|---|
| Main template | custom.php |
Site HTML structure (header, footer, nav) |
| Custom functions | php/custom/functions.php |
WordPress hooks, filters, custom PHP |
| Menu positions | php/custom/menus.php |
Register additional menu locations |
| Widget areas | php/custom/widgets.php |
Register additional widget areas |
| Shortcodes | php/custom/shortcodes.php |
Define custom shortcodes |
| Feature flags | php/custom/features.php |
Toggle custom features |
| Template routing | php/custom/router.php |
Custom template routing logic |
| Option pages | php/custom/options.php |
Custom ACF admin pages |
| Page templates | php/custom/templates/ |
PHP template files |
| Block overrides | php/custom/blocks/ |
Block rendering overrides |
| Module overrides | php/custom/modules/ |
Module rendering overrides |
| Custom styles | css/custom/ |
SCSS files organized by SMACSS |
| Custom scripts | js/scripts.ts |
TypeScript entry point |
| Breakpoints | css/tailwind/breakpoints.json |
Screen breakpoints (shared by CSS, JS, PHP) |
| Tailwind theme | css/tailwind/theme.js |
Colors, fonts, spacing |
The parent theme uses .dist files as templates for child theme customization:
.htaccess → .htaccess
custom.dist.php → custom.php
css/custom/custom.dist.scss → css/custom/custom.scss
css/tailwind/breakpoints.dist.json → css/tailwind/breakpoints.json
css/tailwind/presets.dist.js → css/tailwind/presets.js
css/tailwind/theme.dist.js → css/tailwind/theme.js
js/scripts.dist.ts → js/scripts.ts
js/custom/scripts/module.dist.ts → js/custom/scripts/module.ts
php/custom/templates/404.dist.php → php/custom/templates/404.php
php/custom/templates/search.dist.php → php/custom/templates/search.php
css/lib/*/_*.dist.scss → css/custom/*/_*.scss
When you run bun install, the postinstall.sh script copies these dist files into the child theme only if they don't already exist. This ensures:
- New installations get a working starting point
- Existing customizations are never overwritten
- Theme updates can add new dist files without disrupting existing projects
All PHP code is namespaced under lqx\*:
| Namespace | File | Purpose |
|---|---|---|
lqx\setup |
php/setup.php |
Theme initialization and features |
lqx\customizer |
php/customizer.php |
Theme customizer settings |
lqx\router |
php/router.php |
Template routing engine |
lqx\util |
php/util.php |
Utility functions |
lqx\blocks |
php/blocks.php |
Block system (settings, rendering, presets) |
lqx\layouts |
php/layouts.php |
Layout block registration |
lqx\modules |
php/modules.php |
Module loading and rendering |
lqx\cards |
php/cards.php |
Card component utilities |
lqx\css |
php/css.php |
CSS enqueuing and critical path |
lqx\js |
php/js.php |
JavaScript enqueuing and GTM |
lqx\filters |
php/filters.php |
Post filtering system |
lqx\fields |
php/fields.php |
ACF field utilities |
lqx\meta |
php/meta.php |
Meta tag rendering |
lqx\favicon |
php/favicon.php |
Favicon rendering |
lqx\body |
php/body.php |
Body class generation |
lqx\ip2geo |
php/ip2geo.php |
IP geolocation |
lqx\browsers |
php/browsers.php |
Outdated browser detection |
lqx\modules\alerts |
php/modules/alerts/ |
Alert messages |
lqx\modules\cta |
php/modules/cta/ |
Call-to-action |
lqx\modules\modal |
php/modules/modal/ |
Modal dialogs |
lqx\modules\popup |
php/modules/popup/ |
Popup notifications |
lqx\modules\share |
php/modules/share/ |
Social sharing |
lqx\modules\social |
php/modules/social/ |
Social media icons |
The functions.php file loads all PHP modules in this order:
util.php- Utility functions (available to everything else)comments.php- Comment handlingsetup.php- Theme setup and feature registrationmenus.php- Menu position registrationwidgets.php- Widget area registrationcustomizer.php- Theme customizer settingsblocks.php- Gutenberg blocks systemcards.php- Card component utilitieslayouts.php- Layout blocksmodules.php- Module systemtailwind.php- Tailwind integrationmeta.php- Meta tag preparationcss.php- CSS enqueuingjs.php- JavaScript enqueuingfavicon.php- Favicon renderingbody.php- Body class preparationrouter.php- Template routingip2geo.php- IP geolocationbrowsers.php- Browser detectionfilters.php- Post filteringlivereload.php- Development livereloadfeatured-posts.php- Featured postsfields.php- ACF field utilitiesphp/custom/functions.php- Child theme custom functionsphp/custom/shortcodes.php- Child theme shortcodesupdate.php- Theme update checkercritical.php- Critical path CSS endpointmisc.php- Miscellaneous functions
Note that custom/functions.php and custom/shortcodes.php are loaded from the child theme (get_stylesheet_directory()), while all other files are loaded from the parent theme (get_template_directory()).
The site's HTML structure is defined in custom.php (copied from custom.dist.php). This file controls:
- Document
<head>(meta tags, GTM, wp_head, favicons) - Body structure (header, main, footer)
- Navigation menus
- Module placement (alerts, CTAs, popups, social)
- Footer scripts (wp_footer, Lyquix options, livereload)
The default template includes:
- Skip-to-content accessibility link
- Header with alerts, top/main/utility/logged-in menus
- Main content area with template router output
- CTA module after main content
- Footer with bottom/footer menus, social icons, sharing
- Popup module
- Browser alert
- LiveReload
The theme supports a "chromeless" page template that renders only the router output without header, footer, or navigation. This is useful for pages embedded in iframes or API responses.
The theme stores ACF field group definitions as JSON files in acf-json/. There are 40+ field groups covering:
- Block global settings (per block type)
- Block user settings (per block instance)
- Block admin settings (per block instance override)
- Block styles and presets
- Block content fields
- Module settings
- Filter configuration