Overview

A flexible CSS Grid container for building complex, responsive layouts with precise control over columns, rows, and spacing.


Usage

The Advanced Grid implements a 24‑column Bootstrap grid system through a three‑tier nesting structure: Grid → Row → Column. Each Column can independently control its span (1–24), offset (0–24), and visual order at every breakpoint, enabling complex responsive layouts that go well beyond WordPress’s native columns block.

  1. Insert an Advanced Grid block.
  2. Add one or more Row blocks inside it.
  3. Add Column blocks inside each Row and configure their span/offset.
  4. Place any content blocks inside the Columns.

Enable the Highlight Grid Structure toggle in the Grid’s inspector to visualize the grid, rows, and columns with visible outlines during editing.


Child Blocks

Advanced Grid (method/advanced-grid)

  • Block name: method/advanced-grid
  • Category: method-layout-blocks
  • Render type: Dynamic (PHP render_callback)
  • Inner blocks: Yes — method/advanced-grid-row only

The outermost wrapper. Houses rows and provides grid‑level spacing and typography.

AttributeTypeDefaultDescription
highlightGridbooleanfalseOutlines grid structure in the editor (no frontend effect)
responsiveSettingsobject(standard breakpoints)Spacing and typography per breakpoint

Control sets: MethodSpacingControls (padding, margin), MethodTypographyControls, MethodResponsiveTabs, MethodStyleTag


Row (method/advanced-grid-row)

A structural row that groups columns. Provides flex alignment and gap controls.

  • Parent: method/advanced-grid
  • Allowed children: method/advanced-grid-col
AttributeTypeDefaultDescription
responsiveSettingsobject(standard breakpoints)Spacing, alignment, typography, gap per breakpoint

Control sets: MethodAlignmentControls (alignItems, justifyContent), MethodSpacingControls (padding, margin, gap — horizontal/vertical), MethodTypographyControls, MethodResponsiveTabs, MethodStyleTag


Column (method/advanced-grid-col)

An individual column with configurable span, offset, and order.

  • Parent: method/advanced-grid-row
  • Inner blocks: Accepts any blocks
AttributeTypeDefaultDescription
textColorstring—Text color
linkColorstring—Link color
bgColorstring—Background color
bgGradientstring—Background gradient
bgShadeColorstring—Shade overlay color
bgShadeGradientstring—Shade overlay gradient
responsiveSettingsobject(see below)Column span, offset, order, spacing, and typography per breakpoint

Default responsiveSettings:

JSON
{
  "base":   { "enabled": true,  "gridCols": 8 },
  "mobile": { "enabled": false, "gridCols": 24 },
  "tablet": { "enabled": false, "gridCols": 12 },
  "wide":   { "enabled": false, "gridCols": 6 }
}

Per‑breakpoint column properties:

  • gridCols (1–24) — number of columns to span
  • offset (0–24) — number of columns to offset from the left
  • order — CSS order value for reordering columns
  • hide — mobile, tablet and wide only: hides the column at that breakpoint (display: none; visibility: hidden)

Control sets: Column Options panel (RangeControl for gridCols and offset), MethodSpacingControls (padding all sides, margin top/bottom), MethodTypographyControls, MethodColorControls (textColor, linkColor), MethodAddtControls (hide, in the mobile / tablet / wide tabs), MethodResponsiveTabs, MethodStyleTag, useResponsiveSetter


Frontend Rendering

The PHP render builds Bootstrap grid classes from the responsiveSettings:

HTML
<div class="method-advanced-grid" id="method-{id}">
  <!-- Row -->
  <div class="method-advanced-grid-row-wrap" id="method-{id}">
    <div class="row method-advanced-grid-row">
      <!-- Column -->
      <div class="col-{n} offset-{n} col-md-{n} offset-md-{n} ..." id="method-{id}">
        <div class="method-advanced-grid-col-content">
          {inner content}
        </div>
      </div>
    </div>
  </div>
</div>

Column classes use Bootstrap’s breakpoint prefixes (e.g., col-md-8 offset-md-2 col-lg-6 offset-lg-3), derived from method_get_breakpoint_class_prefixes().


Filters

This block does not currently expose dedicated PHP filters. The breakpoint prefix mapping is controlled by method_get_breakpoint_class_prefixes() in the theme’s helper functions.


Changelog

VersionDescription
2.0.0-alpha4Introduced (121d149).
2.0.0-beta17Column Hide toggle per responsive breakpoint via MethodAddtControls, read by the render callback (b4c7dcb); column content margin resets changed to margin-block-start: 0 on the first child, with the last-child bottom reset removed (cce9f89); Inserter title prefixed, “Method Advanced Grid” (c34e9bb).
2.0.0-beta22A new Column starts with a placeholder paragraph (“Column content goes here…”) instead of an empty inner area (4f34c8b); Retitled “Advanced Grid (Method)” and given the method keyword (93e1fcf).
2.0.0-beta31Editor icon redrawn in the outlined style the Method icons now share; the block’s markup and attributes are unchanged (cd6f63f).