A WordPress block editor plugin that adds a date range filter to the Query Loop block, allowing you to display either future or past dated posts.
This plugin extends the core Query Loop block by adding a date range filter in the block settings sidebar. You can choose to display:
- All posts (default)
- Only future dated posts
- Only past dated posts
Perfect for showing upcoming events, future scheduled posts, or filtering out old content.
- Download the latest release from the release section
- Install the plugin through the 'Plugins' screen in WordPress
- Activate the plugin through the 'Plugins' screen in WordPress
- Add a Query Loop block to your page/post
- Open the block settings sidebar
- Look for the "Date Range Settings" panel
- Select your desired date range:
- All Dates
- Future Dates
- Past Dates
- Node.js
- npm
-
Clone this repository
git clone https://github.com/sandymcfadden/query-loop-future-filter.git cd query-loop-future-filter -
Install dependencies:
npm install
The plugin uses @wordpress/scripts for build processes. Available commands:
Create a production build:
npm run buildquery-loop-future-filter/
├── build/ # Compiled files
├── src/ # Source files
│ └── index.js # Main JavaScript file
├── .gitignore
├── package.json
├── README.md
└── query-loop-future-filter.php
Heavily inspired from https://rudrastyh.com/gutenberg/query-loop-block-variation.html