Query Builder is similar to core Query Loop block, but it has next enhancements
- More query selectors. (by post type, custom taxonomy, manual select)
- More Order options (by title, id, custom field value, date, random order, date of post changes)
- More pagination options (simple pagination, Infinite Scroll)
- Filter panel (by meta field value, by taxonomy + taxonomy selector)
- Responsive options (choose number of columns per each resolution
- Design options for items (background, spacing, border, shadow)
- Better default view
- Support for Wishlist archives (you need to enable auto detection in Data query settings)
- Support for Full Container link
- Custom ads areas
- Conversion to carousel
You can also add any kind of blocks inside Query Builder. We also prepared some dynamic fields special for Query Builder
Do you want to know more about Query builder?
Check our video
Patterns
Query Builder has many patterns. You can easily import them and configure by your needs with custom effects. This is example of grid with hover effect
Hooks and filters in Query Builder
Query builder is a very powerful swiss knife block for any loop maker. It has also few filters and hooks which you can use to extend it or add compatibility with other plugins.
How to show post classes on each grid
By default, grid item shows only type of post and post id. But you can extend to show all categories, tags, etc. Here is snippet
add_filter('gspbgrid_item_class', 'gs_item_class', 10, 3);
function gs_item_class($class, $postid, $block_instance){
$classnew = get_post_class('', $postid);
$classnew = implode(' ', $classnew);
$class = $class. ' '.$classnew;
return $class;
}
Also, you can change $args of loop. We have filter and action for this. Example
add_filter( 'gspb_module_args_query', function( $args ) {
if ( ! is_admin() ) {
$args['wp_grid_builder'] = 'wpgb-content';
}
return $args;
});
This filter will change $args of WP_Query class before it runs.
You can also use action which will affect wp_query after WP_Query
add_action('gspb_after_module_args_query', function ($wp_query){
return $wp_query;
});