Share Your Thoughts

Creates Advanced Query with Zion Builder Repeater

Zion Builder repeater is a powerful weapon for any site. It is very flexible and you can make unlimited custom providers. ZiUltimate made one custom provider “Ultimate Query Builder” and users can build any type of query for their content like post, page, cpts.

Ultimate Query Builder Type for Repeater

You will select the “Ultimate Query Builder” from the Query Type dropdown. You will get a code editor and put the query arguments there like the above screenshot. There have tons of tutorials on the net and you can easily make the query args. At first, you will follow these two links and understand the query parameter for WP Query.

  1. https://developer.wordpress.org/reference/classes/wp_query/
  2. https://luetkemj.github.io/wp-query-ref/
  3. https://rudrastyh.com/wordpress/meta_query.html

Quick Workthrough

Here is the codes which I used in the video

<?php

return [
	'post_type' 		=> 'product',
	'post_status' 		=> 'publish',
	'posts_per_page' 	=> 8,
	'no_found_rows' 	=> 1,
	'orderby' 			=> 'title',
	'order' 			=> 'ASC'
];

Will It work with taxonomy?

Yes. I said that you can build any type of query(like meta query, date query, tax query, etc) with this custom provider. I already tested and built a category filterable page for the WooCommerce products.

Filter By Taxonomy Terms

I used the following query arguments in the code.

<?php

$query_args = [
	'post_type' 		=> 'product',
	'post_status' 		=> 'publish',
	'posts_per_page' 	=> 8,
	'tax_query' 		=> [
		'relation'	=> 'AND'
	],
	'orderby' 			=> 'title',
	'order' 			=> 'ASC'
];

if( isset( $_GET['cat'] ) ) {
	$query_args['tax_query'][] = [
		'taxonomy' 	=> 'product_cat',
		'field' 	=> 'slug',
		'terms' 	=> [ esc_html( $_GET['cat'] ) ],
		'operator' 	=> 'IN'
	];
}

return $query_args;