Repository navigation
Blocks Query Group Header
Block name: designsetgo/query-group-header
Added in: 2.1.0
Category: DesignSetGo
Block family: Query (parent) · Query Results · Query Pagination · Query Filter · Query Group Header · No Results
The Query Group Header block renders once per group when the Query Results block has group-by enabled. It is placed inside the item template (inside the Query Results inner blocks), and at render time the server extracts it from the template, renders it with the current group's label and value injected as block context, and prepends it to the items in that group.
Without group-by enabled on the parent Query Results block, this block renders as an ordinary InnerBlocks container and has no special behavior.
| Attribute | Type | Default | Notes |
|---|---|---|---|
tagName |
string | "header" |
HTML wrapper element: header, div, or section
|
The block consumes three context keys set by the parent Query and its render pipeline:
| Context key | Type | Description |
|---|---|---|
designsetgo/queryId |
string | The parent query's unique ID |
designsetgo/groupLabel |
string | Human-readable group label (term name, meta value, or formatted date) |
designsetgo/groupValue |
string | Machine-readable group value (term slug, meta value, or date string) |
HTML element — choose the wrapper tag: header (default), div, or section.
Typography, spacing, and color supports are available in the Styles panel via WordPress's native block supports.
To display the current group's label inside the block, you have two options:
Any block inside Query Group Header that supports the WordPress 6.9 Block Bindings API can be bound to the designsetgo/groupLabel or designsetgo/groupValue context values. For example, bind a Heading block's content to the group label:
In the editor, select a Heading block inside the group header, open the Bindings panel, and connect content to the designsetgo/groupLabel context source.
The DesignSetGo Dynamic Tags toolbar picker (available on any block's rich text) can bind text content to designsetgo/groupLabel or designsetgo/groupValue directly from the inline toolbar. This works on any block that accepts inline text, including Paragraph and Heading.
When groupBy is configured on Query Results, the server-side render pipeline:
- Runs the query and collects all post IDs in order
- Calls
designsetgo_query_partition_items()to bucket the IDs into groups (by taxonomy term, meta value, or date) - For each group, renders the Query Group Header block(s) found in the template with the group's
labelandvalueinjected as context - Renders the item template for each ID in the group
- Wraps the header + items in
<section class="dsgo-query-group" data-dsgo-group-value="...">
Posts with multiple taxonomy terms (when grouping by taxonomy) appear in all matching groups. Posts with no matching term land in an "Uncategorized" bucket.
The editor preview shows a visual grouping with a placeholder group label. An informational notice appears in the editor if group-by is set but no Query Group Header block is found in the template.
For a taxonomy-grouped query, one group renders as:
<section class="dsgo-query-group" data-dsgo-group-value="photography">
<header class="dsgo-query-group-header wp-block-designsetgo-query-group-header">
<!-- inner blocks, e.g. a heading bound to groupLabel -->
<h3>Photography</h3>
</header>
<li class="dsgo-query__item"><!-- item --></li>
<li class="dsgo-query__item"><!-- item --></li>
</section>A typical grouped blog index with year headings:
- Configure Query Results with
groupBy: { field: "date", key: "Y" } - Place a Query Group Header block at the top of the item template
- Inside the header, insert a Heading (H2)
- Bind the heading's content to
designsetgo/groupLabelvia Block Bindings or Dynamic Tags
At render time each year appears as an H2 heading above its group of posts.
- The wrapper element defaults to
<header>, which carries implicit ARIA landmark semantics inside a<section>; change to<div>if the landmark is not desired - Group sections use
<section class="dsgo-query-group">on the server, which is a landmark element when it has an accessible name; add anaria-labelledbypointing to the group header heading if you want screen readers to enumerate sections
- Dynamic Query — parent container; group-by is configured via Query Results
-
Query Results — owns the
groupByattribute that activates this block - No Results — shown when the grouped query has no items
Auto-generated from
docs/blocks/QUERY-GROUP-HEADER.md. To update, edit the source file and changes will sync on next push to main.
- Accordion
- Advanced Heading
- Blobs
- Breadcrumbs
- Card
- Chart
- Comparison Table
- Countdown Timer
- Counter Group
- Divider
- Dynamic Image
- Fifty Fifty
- Flip Card
- Form Builder
- Grid
- Hotspot
- Icon
- Icon Button
- Icon List
- Image Accordion
- Map
- Modal
- Modal Api Reference
- Modal Auto Triggers
- Modal Fse Compatibility
- Modal Gallery Navigation
- Modal Trigger
- Pill
- Product Categories Grid
- Product Showcase Hero
- Progress Bar
- Query
- Query Filter
- Query Group Header
- Query No Results
- Query Pagination
- Query Results
- Row
- Scroll Accordion
- Scroll Marquee
- Scroll Slides
- Section
- Section Divider
- Slider
- Star Rating
- Sticky Sections
- Table Of Contents
- Tabs
- Text Path
- Timeline
- Background Video
- Block Animations
- Clickable Group
- Conditional Visibility
- Custom Css
- Draft Mode
- Dynamic Tags
- Expanding Background
- Grid Mobile Order
- Grid Span
- Hover Effects
- Max Width
- Responsive Visibility
- Reveal Control
- Scroll Parallax
- Sticky Header
- Style Binding
- Svg Patterns
- Text Alignment Inheritance
- Text Reveal
- Abilities Api
- Abilities Api Guide
- Block Bindings
- Draft Mode Api
- Form Webhooks
- Generation Contract
- Interactive Blocks
- Layout Flexibility
- Markdown Content Negotiation
- Rest Api Reference
- Wp Cli Reference
- Ai Assisted Development
- Best Practices Summary
- Block Controls Organization
- Block Development Best Practices Comprehensive
- Block Exclusion Guide
- Deploying To Wordpress Org
- Design System
- 2026 04 16 Blocks Editor Ux Design
- 2026 04 17 Theme 3 Inspector Ia
- 2026 04 21 Query Block Onboarding
- 2026 04 21 Query Capable Layout Blocks Design
- 2026 04 27 Block Roadmap Ideas
- 2026 07 01 Shape Divider Theme Inheritance
- 2026 07 02 Icon Block Dynamic Render Pilot
- 2026 07 06 Section Divider Block Design
- 2026 07 06 Section Style Variations Fse Design
- 2026 07 06 Section Styles Editor Preview
- 2026 07 07 Row Grid Overlay Hover Parity Design
- 2026 07 21 Conditional And Dup Label Sourcing
- 2026 07 23 Theme Block Type Animation Defaults
- 2026 08 16 Chart Block
- 2026 08 16 Greenshift Gap Roadmap
- 2026 08 17 Woocommerce Surface
- 2026 08 24 Loop Carousel
- 2026 08 24 Star Rating Block
- 2026 09 17 Abilities Drift Prevention
- 2026 09 17 Abilities Drift Prevention Implementation
- 2026 09 29 Existing User Regression Fixes
- 2026 09 29 Release Preflight Fixes
- Readme
- 2026 07 02 Block Authorability Audit
- 2026 09 29 Regression Fixes
- 2026 09 29 Release 2.9.0
- 2026 09 29 Release Fixes
- 2026 10 19 Bug Hunt
- 2026 10 20 Bug Hunt Round 2