The Lyquix theme provides 14 custom Gutenberg content blocks powered by Advanced Custom Fields PRO. Content blocks feature a three-level settings system, configurable presets and styles, and child theme override capability.
| Block | Description |
|---|---|
| Accordion | Collapsible content sections with optional images, subheadings, and custom classes |
| Accordion Plus | Enhanced accordion with additional features |
| Banner | Hero-style banner with text/image overlay and optional breadcrumbs |
| Cards | Content cards with images, icons, videos, labels, and links |
| Filters | AJAX-powered post filtering by category, tags, taxonomies, and ACF fields |
| Gallery | Image/video gallery with filtering, thumbnails, teasers, and lightbox |
| Hero | Large hero with breadcrumbs, heading override, intro text, images, video, and CTAs |
| Logos | Logo grid/carousel with optional links, titles, and padding |
| Map | Google Maps with markers, info windows, business hours, phone numbers, and labels |
| Slider | Carousel with text, images, mobile images, video, thumbnails, and teaser text |
| Tabs | Tabbed content interface with images and subheadings |
| Tabs Plus | Enhanced tabs with additional features |
| Testimonial | Testimonial carousel with images and custom colors |
All content blocks are registered under the Lyquix Content Blocks category in the Gutenberg editor.
Additionally, two blocks are registered under the standard Embed category for embedding social media content:
| Block | Description |
|---|---|
Facebook Embed (lqx/facebook) |
Embeds a Facebook post, reel, or video with live editor preview |
Instagram Embed (lqx/instagram) |
Embeds an Instagram post, reel, or video with live editor preview |
Both blocks validate and normalize the pasted URL, display an inline error for invalid links, support alignment and anchor attributes, and load their respective SDKs only on pages where they are used.
Every content block uses a hierarchical settings system:
Global Settings (site-wide defaults for this block type)
↓
Preset Override (saved configuration applied to this instance)
↓
User Settings (per-instance settings set by the editor)
↓
Admin Settings (per-instance overrides set by administrators)
↓
Final Rendered Output
Configured in the WordPress admin under Site Settings > [Block Name]. These are the default values for every instance of a block type across the entire site. For example, you might set the default number of columns for all Cards blocks.
Named visual variations for a block. Styles are defined globally and selected per-instance. When a style is selected, its CSS class is added to the block's wrapper element. Examples: "dark", "compact", "full-width".
Saved configurations that bundle multiple settings together. A preset overrides global settings with predefined values. For example, a "Blog Cards" preset might set specific column counts, image sizes, and label visibility.
Presets are defined globally under Site Settings > [Block Name] and selected per-instance in the editor.
Per-instance settings that the content editor can modify. These include selecting a style, choosing a preset, and any block-specific options.
Per-instance overrides that only administrators can see and modify. These use an "override group" pattern where each setting has a checkbox to enable the override and a field for the override value. Admin settings take the highest priority.
The settings are merged using these functions from \lqx\blocks:
process_overrides()- Extracts override values from_override_groupfieldsremove_empty_settings()- Strips null/empty values to avoid overwriting with blanksmerge_settings()- Recursively merges settings, with later values taking priority
The merge order is:
$processed = global_settings;
$processed = merge(processed, preset_settings); // if preset selected
$processed = merge(processed, admin_settings); // if admin overrides setEach block in php/blocks/ follows this structure:
php/blocks/{block-name}/
├── block.json # WordPress block registration
├── default.php # Default render function
├── default.tmpl.php # Default render template
└── (optional preset/sub-template files)
Standard WordPress block registration file. Defines the block name, title, category, icon, and ACF field associations.
The renderer loads settings and content, then includes the template:
<?php
$settings = \lqx\blocks\get_settings($block);
$content = \lqx\blocks\get_content($block);
require \lqx\blocks\get_template($settings['processed']['block'], $settings['processed']['preset']);The template contains the actual HTML output using $settings and $content variables.
To customize a block's rendering, create files in php/custom/blocks/{block-name}/:
For the renderer:
php/custom/blocks/{block-name}/{preset}.php(preset-specific renderer)php/custom/blocks/{block-name}/default.php(custom default renderer)php/blocks/{block-name}/default.php(parent theme default)
For the template:
php/custom/blocks/{block-name}/{preset}.tmpl.php(preset-specific template)php/custom/blocks/{block-name}/default.tmpl.php(custom default template)php/blocks/{block-name}/default.tmpl.php(parent theme default)
Create php/custom/blocks/cards/default.tmpl.php:
<?php
// Custom cards rendering
$s = $settings['processed'];
$items = $content['items'] ?? [];
?>
<div id="<?= $s['anchor'] ?: $s['hash'] ?>"
class="lqx-block-cards <?= $s['class'] ?>">
<?php foreach ($items as $item) : ?>
<div class="card">
<!-- Your custom card HTML -->
</div>
<?php endforeach; ?>
</div>Create php/custom/blocks/cards/blog-cards.php for a preset named "blog-cards":
<?php
$settings = \lqx\blocks\get_settings($block);
$content = \lqx\blocks\get_content($block);
// Custom logic for blog cards preset
require \lqx\blocks\get_template($settings['processed']['block'], $settings['processed']['preset']);The theme includes a JavaScript file (php/blocks/field-display.js) that controls field visibility in the Gutenberg editor. Fields can be conditionally shown or hidden based on the value of "controller" fields in the global settings.
For example, if the global setting show_image is set to "n", the image field is hidden in the editor for all instances of that block. This is configured through a rules array:
{
"field": "image", // Field to show/hide
"controller": "show_image", // Controller field name
"operator": "==", // Comparison operator
"value": "y" // Value that makes the field visible
}To add entirely new blocks, create a directory in php/custom/blocks/{block-name}/ with:
block.json- Block registration following the WordPress Block APIdefault.php- Render functiondefault.tmpl.php- Render template
The parent theme automatically discovers and registers blocks from both php/blocks/*/block.json (parent) and php/custom/blocks/*/block.json (child).
Returns the complete settings array for a block instance, including global, preset, user, and admin settings merged together.
Parameters:
$block- Block array (from Gutenberg) or block name string$post_id- Optional post ID (defaults to current post)$forced_preset- Optional preset name to force$forced_style- Optional style name to force
Returns: Array with keys global, styles, presets, local, and processed
Returns the content fields for a block instance.
Renders a block using the appropriate renderer based on preset and overrides.
Returns the file path to the block's renderer PHP file.
Returns the file path to the block's template PHP file.
The theme provides an admin page under Site Settings > Reset Global Settings that allows administrators to reset global settings for any or all blocks and modules back to their default values. This is useful when settings have been modified and you want to start fresh.