[ad_1]
Plugin Support
ying
(@yingscarlett)
Hi there,
It will require some PHP code.
- Add a css class to the Grid block nested in the query loop block, eg.
multi-query:https://wordpress.com/support/wordpress-editor/adding-additional-css-classes-to-blocks/ - Add this PHP code, and change this line
array('post', 'page', 'cpt-slug-1', 'cpt-slug-2');to match your post types.
add_filter( 'generateblocks_query_loop_args', function( $query_args, $attributes ) {
if (
! is_admin() &&
! empty( $attributes['className'] ) &&
strpos( $attributes['className'], 'multi-query' ) !== false
) {
// pass meta_query parameter
$query_args[ 'post_type' ] = array('post', 'page', 'cpt-slug-1', 'cpt-slug-2');
}
return $query_args;
}, 10, 2 );Adding PHP: https://docs.generatepress.com/article/adding-php/
