Skip to content

Latest commit

 

History

5 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GB Query Filter

GB Query Filter is a lightweight WordPress plugin that adds customizable front-end filters to the GenerateBlocks Query Loop block. It enables live filtering based on taxonomies, custom fields, sort order, and search terms while maintaining full compatibility with GenerateBlocks 2.0+.

The plugin integrates with a custom block that links directly to the Query Loop, supports optional AJAX filtering, and syncs all filter states to the URL for shareable filter results.

Features

Front-End Filters

Supports filtering by: Taxonomies - Meta Box Custom Fields & Taxonomies - Search Term

Filter control types include: Select - Checkbox - Radio

Additional filter features: Multiple selections - Default states - Reset button

Block-Based Integration

The plugin registers a custom block that connects to GenerateBlocks' Query Loop. Users can configure: - Post types - Taxonomy filters - Meta key filters - Sort options - Front-end filter behavior - AJAX vs. full-page reload mode

URL Parameter Sync

Filter states are synced to the URL using the GB Query Filter naming pattern:

?gbqf_tax[category]=news,events
?gbqf_meta[color]=blue
?gbqf_sort=title_asc
?gbqf_search=steel+railings

On page load, the plugin restores all filter states from the URL.

Optional AJAX Support

Two filtering modes are available: 1. Full page reloads 2. AJAX filtering and pagination (if enabled)

Installation

From GitHub

  1. Download the repository ZIP.
  2. Upload it to WordPress under Plugins → Add New → Upload Plugin.
  3. Activate the plugin.
  4. Add the GB Query Filter block to any page containing a GenerateBlocks Query Loop.

Usage

  1. Create or edit a page with a GenerateBlocks Query Loop block.
  2. Add the GB Query Filter block above the Query Loop.
  3. Configure the filter settings:
    • Link filter to query
    • Choose taxonomies
    • Choose meta fields
    • Set default values
    • Enable or disable AJAX
  4. Publish or update the page.

URL Structure

Examples of URL parameters generated by the plugin:

Taxonomy filters

?gbqf_tax[category]=news,updates

Meta field filters

?gbqf_meta[price]=100-200

Search term

?gbqf_search=modern+stairs

Developer Notes

  • Uses native WordPress block APIs, REST endpoints, and WP_Query modifications.
  • Does not modify GenerateBlocks core.
  • Filters only affect the inner post query of the Query Loop block.
  • Compatible with caching plugins when AJAX is disabled.
  • Designed for extensibility and future integrations.
  • Not affiliated with GeneratePress, GenerateBlocks, or GenerateOne
  • Use at your own risk

Roadmap

  • Additional filter UI layouts
  • Range sliders for numbers, price, or dates
  • Saved filter presets
  • Multiple filter groups per page

Contributing

Pull requests and issues are welcome. Contributions should follow WordPress coding standards and Git-based workflows.

License

Licensed under the GPL-2.0-or-later license. You are free to modify, extend, and distribute the plugin.

About

A simple plugin that adds a filter for the GenerateBlocks Pro plugin

Resources

Stars

11 stars

Watchers

2 watching

Forks

Releases

Packages

Contributors

Languages