WordPress plugin that extends Query Loop blocks with Search and Taxonomy filtering capabilities.
- Automatically filters Query Loop blocks based on Search block input
- Resets Query Loop to initial state when search is cleared
- Works with core Search block
- Custom block for filtering Query Loop by taxonomy terms
- Three display styles: Dropdown, Buttons, and Checkboxes
- Supports single or multiple term selection
- Highlights selected terms on page refresh
- Automatically filters Query Loop blocks when selection changes
- Upload the plugin to
/wp-content/plugins/4wp-ql-blocks/ - Activate the plugin through the 'Plugins' menu in WordPress
- Build the assets:
npm install && npm run build
# Install dependencies
npm install
# Build for production
npm run build
# Start development mode with watch
npm startSimply add a Search block and a Query Loop block on the same page. The Query Loop will automatically filter results based on the search query.
- Add the "4WP QL Taxonomy Filter" block to your page
- Select a taxonomy (e.g., Categories, Tags, or custom taxonomy)
- Choose a display style (Dropdown, Buttons, or Checkboxes)
- Optionally enable "Show Count" to display post counts
- Optionally enable "Allow Multiple Selection" for checkboxes
- Add a Query Loop block - it will automatically filter based on the taxonomy selection
- Taxonomy: The taxonomy to filter by (default: category)
- Query ID: Optional - link to a specific Query Loop block by its queryId
- Display Style: Dropdown, Buttons, or Checkboxes
- Show Count: Display the number of posts for each term
- Allow Multiple Selection: Allow selecting multiple terms (checkboxes only)
- Namespace:
ForWP\QLBlocks - Requires PHP 8.0+
- Requires WordPress 6.0+
- Built with @wordpress/scripts
MIT