jcore / dynamic-archive
JCORE Dynamic Archive module
Package info
github.com/JCO-Digital/jcore-dynamic-archive
Type:wordpress-plugin
pkg:composer/jcore/dynamic-archive
Requires
- composer/installers: ^2.3
- jcodigital/jcore-update: ^1.1
Requires (Dev)
Suggests
None
Provides
None
Conflicts
None
Replaces
None
- dev-main
- v1.0.9
- v1.0.8
- v1.0.7
- v1.0.6
- v1.0.5
- v1.0.4
- v1.0.3
- v1.0.2
- v1.0.1
- v1.0.0
- v0.25.3
- v0.25.2
- v0.25.1
- v0.25.0
- v0.24.2
- v0.24.1
- v0.24.0
- v0.23.1
- v0.23.0
- v0.22.0
- v0.21.0
- v0.20.0
- v0.19.1
- v0.19.0
- v0.18.0
- v0.17.0
- v0.16.4
- v0.16.3
- v0.16.2
- v0.16.1
- v0.16.0
- v0.15.1
- v0.15.0
- v0.14.0
- v0.13.1
- v0.13.0
- v0.12.2
- v0.12.1
- v0.12.0
- v0.11.0
- v0.10.2
- v0.10.1
- v0.10.0
- v0.9.0
- v0.8.0
- v0.7.2
- v0.7.1
- v0.7.0
- v0.6.6
- v0.6.5
- v0.6.4
- v0.6.3
- v0.6.2
- v0.6.1
- v0.6.0
- v0.5.0
- v0.4.1
- v0.4.0
- v0.3.0
- v0.2.1
- v0.2.0
- dev-fix/harden-request-params
- dev-hotfix/backport-xss-fix-0.24
- dev-hotfix/backport-xss-fix-0.25
- dev-feat/multiselect
- dev-feat/sorting
- dev-feat/extendable-dynamic-archive-exploration
- dev-feat/filterByslug
- dev-feat/freeTextSearch
- dev-feature/installer
- dev-hotfix/composer-version
- dev-feature/wordpress-env
- dev-feat/radioShowAll
- dev-feat/removeLatestPostsStyles
- dev-feature/allLanguage
This package is auto-updated.
Last update: 2026-09-23 13:28:54 UTC
README
A WordPress plugin that adds a filterable, sortable and searchable post archive block, plus a latest/related posts block. Front-end filtering, pagination and "load more" are powered by the Interactivity API and its router, so the archive updates without full page reloads while every state stays linkable through the URL.
Templates are rendered with Timber, and themes can override any of them.
Requirements
- WordPress 6.7 or newer
- PHP 8.1 or newer
- Timber 2.x (installed by the theme or site, not bundled with this plugin)
An admin notice is shown if Timber is missing.
Installation
Install via Composer:
composer require jcodigital/jcore-dynamic-archive
composer/installers places the package in the plugins directory. Activate it as usual, or load it from a must-use plugin together with your Composer autoloader.
Updates are delivered through jcore-update when that package is available.
Blocks
Dynamic Archive (jcore/dynamic-archive)
A post archive with optional front-end controls.
Query
- Post type selection, or Inherit settings from query to follow the current archive (term, author, post type, date, search or blog page).
- Order and order by (date, title, modified, author, ID, menu order).
- Sticky posts: include, exclude or show only sticky posts.
- Hide children (for hierarchical post types).
- Show all languages (Polylang).
Filters
- Taxonomy filters per taxonomy, displayed as checkbox, radio, dropdown or multiselect.
- Hierarchical filters: child terms stay hidden until their parent is selected, and can use a different filter type than the parents.
- Forced terms: restrict the archive (and its filter) to specific terms.
- Free-text search with a configurable label. If Relevanssi is active, it is used for the search.
- User-selectable sorting by date, title, or any taxonomy of the post type.
Layout and pagination
- Columns, masonry grid and posts per page.
- Numbered pagination, or infinite scroll ("load more").
Latest Posts (jcore/latest-posts)
Shows the newest posts of the selected post types, optionally limited to specific terms, with an optional heading, columns, order and sticky post handling. It can also inherit the current archive query.
The Related Posts (JCORE) variation shows posts that share terms with the current post. With backfill enabled, remaining slots are filled with other recent posts of the same post type.
Theme integration
Post teaser (required)
The plugin does not ship a post teaser template. Your theme must provide one, looked up in this order:
| Block | Templates tried |
|---|---|
| Dynamic Archive | dynamic-archive/partials/tease.twig, then partials/tease.twig |
| Latest Posts | latest-posts/partials/tease.twig, then partials/tease.twig |
The template receives post (a Timber post) and nr (the 1-based loop index).
Overriding templates
The plugin's blocks/templates/ directory is registered as a Timber location after the theme's own locations. To override a template, place a file with the same relative path in your theme's Timber views directory, e.g. dynamic-archive/partials/filters/filter-checkbox.twig.
Pagination and "load more" can also be overridden via dynamic-archive/overrides/partials/pagination.twig and dynamic-archive/overrides/partials/load-more.twig.
Overridden templates must escape any block attribute they print (e.g. {{ attributes.searchLabel|e }}).
URL parameters
The archive state lives in the query string, prefixed per block instance as dynamic-archive-{instanceId}-:
| Parameter | Example |
|---|---|
…-taxonomy[{taxonomy}][] |
dynamic-archive-3-taxonomy[category][]=12 |
…-sort |
dynamic-archive-3-sort=title-ASC, tax:category-DESC |
…-search |
dynamic-archive-3-search=hello |
…-archive-paged |
dynamic-archive-3-archive-paged=2 |
Taxonomy filters use term IDs by default. Switch to slugs with the jcore_dynamic_archive_taxonomy_field_type filter, and change the prefix with jcore_dynamic_archive_param_prefix.
Hooks
PHP filters
| Filter | Purpose |
|---|---|
jcore_dynamic_archive_args |
Final WP_Query args of the archive. |
jcore_dynamic_archive_tax_query |
Query args after taxonomy filters are applied. |
jcore_dynamic_archive_tax_query_relation |
Relation between forced term groups (default OR). |
jcore_dynamic_archive_handle_taxonomy_sorting |
Query args when sorting by taxonomy. |
jcore_dynamic_archive_inherited_query_args |
Args inherited from the current main query. |
jcore_dynamic_archive_inherit_sticky |
Apply sticky settings when inheriting the query (default false). |
jcore_dynamic_archive_taxonomies_inherit |
Taxonomy filter configuration used when the block inherits the query. |
jcore_dynamic_archive_taxonomies_filter |
The filter data (taxonomies and terms) passed to the templates. |
jcore_dynamic_archive_taxonomies_filter_query_aware |
Only show terms that match posts in the current result (faceted filters, default false). |
jcore_dynamic_archive_facet_term_query_args |
Query args used to find applicable terms for faceted filters. |
jcore_dynamic_archive_use_post_type_term_usage |
Only show terms used by the selected post type (cached, default false). |
jcore_dynamic_archive_term_post_type_usage_cache_ttl |
Cache TTL for the term usage lookup (default one day). |
jcore_dynamic_archive_term_post_type_usage_post_statuses |
Post statuses counted in the term usage lookup. |
jcore_dynamic_archive_taxonomy_field_type |
id or slug for taxonomy URL parameters. |
jcore_dynamic_archive_param_prefix |
URL parameter prefix per block instance. |
jcore_dynamic_archive_infinite_scroll_max_pages |
Highest page reachable with "load more" (default 50). |
jcore_dynamic_archive_interactivity_context |
Interactivity API context of the block. |
jcore_dynamic_archive_interactivity_state |
Global Interactivity API state. |
jcore_latest_posts_args |
WP_Query args of the Latest Posts block (also applied to the backfill query). |
Example: enable faceted filters for all archives.
add_filter( 'jcore_dynamic_archive_taxonomies_filter_query_aware', '__return_true' );
JavaScript filters (block editor)
| Filter | Purpose |
|---|---|
dynamicArchive.forbiddenPostTypes |
Post types hidden from the post type selector (default ['attachment']). |
jcore.latestPosts.showPostTypes |
Post types offered in the Latest Posts block. |
jcore.latestPosts.taxonomies |
Taxonomies offered for term selection in the Latest Posts block. |
jcore.latestPosts.maxSelected |
Maximum number of selectable post types (default -1, unlimited). |
jcore.latestPosts.maxItems |
Maximum value for posts per page (default 25). |
Development
The block sources live in blocks/ and are built with @wordpress/scripts, using pnpm.
make install # composer install + pnpm install make dev # watch and rebuild blocks make build # production build into blocks/build make make-pot # regenerate languages/jcore-dynamic-archive.pot (requires WP-CLI)
Don't edit files under blocks/build/; they are generated from blocks/src/.
Commits follow Conventional Commits. The changelog and releases are generated from them.
Changelog
See CHANGELOG.md.
License
GPL-2.0-only. See composer.json.