Archive Loop Block
The Archive Loop block displays query results and refreshes over AJAX when visitors change filters. It is the output side of every filtered page built with WPEnhanced Ajax Filter Blocks.
Insert it in the block editor, configure what content to query, choose a loop template, and set layout and pagination options in the block sidebar.
Query basics
Post type
Choose which content the loop queries:
- Auto-detect — Uses the current archive context when the block is placed on a taxonomy or post type archive template.
- Post, Page, or any registered custom post type.
- Product — Available when WooCommerce is active.
The post type must match the Filter Posts block on the same page so filters apply to the correct content.
Post count and offset
| Setting | Description |
|---|---|
| Post count | Number of items per page (default: 10). |
| Post offset | Skip the first N posts—useful for featured sections above the main loop. |
Main loop
Enable Main loop when this Archive Loop is the primary target for filters on the page. Only one loop should be marked main unless you intentionally wire multiple loops with Block selector ID.
Post status
Restrict results to Published posts by default, or include other statuses where your site requires it.
Include and exclude terms
Under Loop options, refine which posts appear before visitors apply filters:
Include
- Categories, tags, or any custom taxonomy
- Custom taxonomy terms with AND/OR logic
- Custom meta (ACF or plain meta key/value pairs)
- Specific authors, on-sale products, featured products, stock status, price range, and rating (WooCommerce)
Exclude
- Categories, tags, custom taxonomies, custom meta
- Specific products (WooCommerce)
On load
Pre-select terms when the page first loads—useful for landing pages that open already scoped to a category or tag.
Use Include current terms on archive templates so the loop respects the category or taxonomy archive being viewed.
Include/exclude settings define the starting query. Filter Posts Item blocks further narrow results when visitors interact.
Sorting
Configure primary and secondary sort order under Loop options → Sorting:
| Sort by | Notes |
|---|---|
| Date, title, menu order, random | Standard WordPress orderings |
| Modified date, comment count | Useful for blogs and forums |
| Custom field / ACF | Sort by meta value (string or numeric) |
| Published date picker / ACF date | Date-based sorting with custom methods |
Set Order to ascending or descending. A Secondary sort breaks ties when the primary field matches.
See Query, sorting, and archives for archive auto-detect behaviour and advanced query patterns.
Loop templates
Loop templates control how each result card is rendered. Choose a template under Loop template in the block sidebar or via the template picker when you first insert the block.
| Template | Best for |
|---|---|
| Blog Style | Standard post grids with image, title, meta, and optional excerpt |
| Minimal List | Compact text-focused lists without heavy imagery |
| Background Image | Cards where the featured image fills the card background with overlay content |
| Shop Style | WooCommerce products with price, rating, and add-to-cart |
| Custom Template | A saved custom loop layout from your site |
Each template exposes toggles for visible elements—featured image, title, author, date, categories, tags, excerpt, read-more link, price, rating, add-to-cart, and more—without needing to edit theme files.
Shop Style options appear when WooCommerce is active and the post type is Product.
See Loop templates and layouts for template selection tips and element toggles.
Grid and layout
Under Grid settings:
| Setting | Description |
|---|---|
| Grid style | Grid (default), Masonry, or Pro-only List and Grid/List switcher |
| Columns | Desktop, tablet, and mobile column counts |
| Equal height | Stretch cards to the same row height in grid mode |
| Custom gutter | Row and column gap between cards |
| Masonry Ajax delay | Milliseconds to wait after AJAX before re-laying masonry (increase on slow hosts) |
List view and the Grid/List view switcher require WPEnhanced Ajax Filter Blocks Pro. The free plugin includes grid and masonry layouts.
See Grid, masonry, and pagination.
Pagination and load more
Under Elements → Load more / pagination:
| Mode | Availability |
|---|---|
| None | No pagination—single page of results |
| Pagination | Numbered page links (free) |
| Load More | Append results with a button |
| Infinite scroll | Load more as the visitor scrolls |
Additional options:
- Pagination position — Top or bottom (Pro unlocks additional positions)
- Load more text / Loading text — Button labels
- Scroll to loop after load more — Keeps the visitor oriented after clicking Load More
- Custom pagination parameter — Override the URL query key used for page numbers
Load More and Infinite scroll require WPEnhanced Ajax Filter Blocks Pro. Standard numbered pagination is included in the free plugin.
Masonry layouts do not support standard pagination—use Load More or infinite scroll instead.
Result count
Enable Result count to show how many items match the current query (e.g. “Showing 1–12 of 48 results”).
| Setting | Description |
|---|---|
| Position | Above or below the loop |
| Single / all / range text | Customize the three message formats |
Result count updates with each AJAX refresh alongside filter changes.
No results message
Customize the text shown when no posts match—default: “Sorry, No posts.” Style it in the Design tab under No results text (colour, typography, alignment, background).
Design basics
The Design tab covers presentation without affecting the query:
- Loop container background, border, spacing, and shadow
- Per-template typography and colours (title, meta, price, categories)
- Pagination and load-more button styling
- Preloader animation and colour during AJAX updates
- Grid/list toggle icon styling (Pro)
Start with content settings, preview on the front end, then adjust design to match your theme.
WooCommerce notes
When querying Product:
- Set loop template to Shop Style for product cards with commerce elements
- Base query supports stock status, on-sale, featured, price range, and rating filters in loop options
- Product-specific filter items (attributes, price, stock) pair with this block—see Filter Posts Item
Common mistakes
- Post type mismatch — Filter Posts set to
Postbut Archive Loop set toProduct(filters will not apply correctly). - Main loop not enabled — Multiple loops on a page and none marked main (filters may not target the intended loop).
- Pagination with masonry — Use Load More instead; numbered pagination is hidden for masonry grid style.
What's next
- Filter Posts block — Configure the filter panel that drives this loop
- Loop templates and layouts — Choose and customize card layouts
- Grid, masonry, and pagination — Layout and paging deep dive