Repository navigation
Blocks Query Pagination
Block name: designsetgo/query-pagination
Added in: 2.1.0
Category: DesignSetGo
Block family: Query (parent) · Query Results · Query Pagination · Query Filter · Query Group Header · No Results
The Query Pagination block adds page navigation to a Dynamic Query. It reads the total page count from the parent query's render state and emits the appropriate navigation controls. It is placed as a sibling of the Query Results block, inside a designsetgo/query parent, and can appear anywhere in the block tree — before or after the results.
The block supports three navigation modes and automatically hides itself when the query fits on one page.
| Attribute | Type | Default | Notes |
|---|---|---|---|
paginationKind |
string | "numbered" |
numbered | loadmore | infinite
|
labelLoadMore |
string | "" |
Button label for load-more; defaults to "Load more" |
labelLoading |
string | "" |
Button label while loading; defaults to "Loading…" |
buttonLabelWhenPaused |
string | "Load more" |
Button label shown after infinite scroll auto-pauses |
showPrevNext |
boolean | true |
Show previous/next links in numbered mode |
autoPauseAfter |
number | 3 |
Number of automatic infinite-scroll loads before showing the manual button |
sentinelOffsetPx |
number | 200 |
How many pixels before the sentinel enters the viewport to trigger a load |
alignment |
string | "left" |
left | center | right — horizontal alignment of pagination controls |
The mode attribute is a legacy alias for paginationKind. New blocks use paginationKind.
Emits a <nav> with an accessible unordered list of page links generated by paginate_links(). Previous and next links are included when showPrevNext is true.
Markup class: dsgo-query-pagination--numbered
Renders a single button that appends the next page of results when clicked. The Interactivity API (actions.loadMore) fetches the next page from POST /designsetgo/v1/query/render, appends the new items to the existing grid, and updates the aria-live result count. Focus moves to the first new item after each load. When the last page is reached the button is removed from the DOM.
Markup class: dsgo-query-pagination--loadmore
Combines automatic loading with a manual fallback button. An IntersectionObserver watches a sentinel <div> placed after the item grid. When the sentinel enters the viewport, the hidden fallback button is programmatically clicked, which triggers the same actions.loadMore path as load-more mode.
Automatic loading pauses after autoPauseAfter loads (default 3). At that point the previously hidden button becomes visible so the user can continue manually. This prevents runaway infinite scrolling on long result sets.
prefers-reduced-motion support: when the user has enabled reduced-motion at the OS level, the IntersectionObserver is never set up and the manual button is shown immediately, maintaining full functionality without automatic motion.
Markup class: dsgo-query-pagination--infinite
Pagination kind — select between Numbered, Load more, and Infinite scroll.
Alignment — left, center, or right alignment for the pagination control.
Show previous/next — toggle for numbered mode; adds ‹ Previous / Next › links.
Load more label — the button text in load-more and the paused-state label in infinite scroll.
Loading label — text shown on the button while a request is in flight.
Auto-pause after — infinite scroll only; number of auto-loads before the manual button appears.
Sentinel offset — infinite scroll only; margin in pixels before the viewport edge at which loading triggers.
The following attributes are exposed via the WordPress 6.9 Block Bindings API (registered in class-block-bindings-support.php), meaning they can be driven by any Block Bindings source via the editor's Connections panel:
labelLoadMorelabelLoadingbuttonLabelWhenPaused
This lets editors connect button labels to post meta or custom sources without custom code — useful for multilingual setups or personalized CTAs.
-
Numbered: standard server-side pagination via WordPress query vars (
paged/page) -
Load more and infinite: AJAX via
POST /designsetgo/v1/query/render; the response is appended to the existing grid without a page reload; the browser URL does not change - Filter changes triggered by the Query Filter block reset pagination back to page 1 automatically
- The block emits nothing when
totalPages < 2
- Numbered pagination is wrapped in
<nav role="navigation" aria-label="Query pagination"> - Load-more button carries
aria-busy="true"and the loading label while a request is in flight - After new items are appended, focus moves to the first new item; if the item element has no naturally focusable child, a temporary
tabindex="-1"is applied and removed on blur - Infinite scroll without reduced-motion: manual button starts hidden and becomes visible only after auto-pause; keyboard and screen-reader users always have a button available
- Infinite scroll with
prefers-reduced-motion: manual button is visible from the start; no automatic loading
- Dynamic Query — the parent container block
- Query Results — the item grid sibling
- Query Filter — filter resets pagination automatically
Auto-generated from
docs/blocks/QUERY-PAGINATION.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