Query Builder Overview
This overview reveals detailed information about all the settings of the JetEngine plugin’s Query Builder functionality.
Query Builder is a tool that helps create lists of items picked up from the general array according to specified conditions. It allows you to query posts, terms, users, comments, SQL tables data, repeater, WooCommerce products, items received via REST API functionality, Custom Content Type items, and reviews.
Besides that, Query Builder allows you to query and display data that you wouldn’t be able to show otherwise, e.g., the information from your database tables.
Query Settings in the WordPress Dashboard
The General Settings section has the following settings:
- Name — a name that will be used for the current query;
- Description — a text describing a query. It will be shown in the Queries List and can be used for info systematization;
- Query Type — a list of options for the query source. The options will be described further;
- Query ID — an optional field that can be used to connect the query with the JetSmartFilters plugin’s filter. The ID set here should repeat the ID mentioned in the filter settings (Query Variable field) and the widget/block/element’s ID put in its settings;
- Cache Query — a switcher activated by default that caches this specific query. It can be deactivated if one faces issues with query operations (like incorrect query results).
Separate guides are available for the options presented in the Query Type list:
- Posts Query;
- Terms Query;
- Users Query;
- Comments Query;
- SQL/AI Query;
- Repeater Query;
- Current WP Query;
- WC Product Query;
- JetFormBuilder Records;
- Custom Content Type Query;
- REST API Query;
- JetBooking Query.
Depending on the picked Query Type, the further settings differ. So, the specific details can be checked in the tutorials presented above.
Query in Use
The Query Builder functionality can be used for different purposes. Here is the description of the widgets/blocks/elements where it can be applied:
- Listing Grid;
- Map Listing;
- Dynamic Chart;
- Dynamic Table;
- Smart Posts List (available with the JetBlog plugin);
- Smart Posts Tiles (available with the JetBlog plugin);
- Text Ticker (available with the JetBlog plugin);
- Advanced Carousel (available with the JetElements plugin);
- Advanced Map (available with the JetElements plugin);
- Query Loop (available with Bricks Builder).
With the Query Builder functionality, many use cases can be implemented in the Listing Grid. For instance, here is a detailed guide on How to Display Featured Posts Using Query Builder.
In the Custom Query tab of the Listing Grid widget, a Use Custom Query toggle should be activated. A needed item can be picked in the Custom Query field.
For the Listing Grid block, the same settings as in Elementor are available.
Bricks editor includes the same settings.
Custom queries can also be used for Map Listings. As an example, a map can be queried by some meta fields related to the content. For instance, if the item is set to “Available,” it will be shown on the map.
To work with custom queries in the Map Listing widget, one should activate the Use Custom Query toggle in the Custom Query tab. Then, the Custom Query field should be completed with the corresponding item.
The Map Listing block has the same query settings as the Elementor’s widget.
Bricks Editor also contains the same Map Listing settings as Gutenberg and Elementor.
The query can also be added as a part of a Dynamic Chart functionality. For the Dynamic Chart, the most common “Posts” query can be used where the needed post type for the query will be specified.
Its settings can be found by following the WordPress Dashboard > JetEngine > Charts Builder path.
The needed query can be selected in the Data Query field.
The How to Create a Dynamic Table Based on SQL Query article should be checked to determine how to build a suitable table for your needs.
Dynamic Table should also be provided with a query beforehand in the WordPress Dashboard > JetEngine > Tables Builder directory.
The Data Query field here is for the previously created query input.
After creating the Dynamic Table, the rest of the settings can be adjusted in the selected editor.
Also, here, the other query can be set. To do so, one should activate the Rewrite table query. The New Query field should contain another query that has not been used before.
The same Dynamic Table settings are presented in the Block Editor.
Smart Posts List
Smart Posts List is similar to Listing Grid, so it can be queried in the same way. For example, posts can be selected based on their author.
To set a query for the Smart Posts List widget, the Query & Controls tab with the Use Custom Query toggle should be opened.
A query can be made custom with the Set custom query generator field or selecting an already created query in the Or use JetEngine Query Builder drop-down list.
Smart Posts Tiles
The Smart Posts Tiles widget also allows various query options. For instance, its items can be queried and put in descending order by date.
Smart Posts Tiles settings match those in the Smart Posts List widget.
Text Ticker can be customized in various ways using Query Builder. For instance, the posts of the last two days with a particular topic (category) can be displayed.
The needed query options can be found in the General tab of the Text Ticker widget.
The Use Custom Query switcher allows adjusting the needed item in the Select query from JetEngine Query Builder field.
Advanced Carousel can be queried as well. For example, it can be used to display images, titles, and descriptions in a particular order.
To enable a custom query in the Advanced Carousel widget, the Use JetEngine query toggle should be switched on in the Slides tab. The needed item should be picked in the Select Query field.
The rest of the steps are described after the Select Query field. The first item should be opened below, and the custom fields should be chosen with the Dynamic Tags button where available (next to the Image, Item Title, and Item Description fields.)
As for the Advanced Map widget, it can be adjusted and queried by “Repeater” meta fields.
In this widget, the Use JetEngine query toggle is in the Pins section. The desired item should be picked in the Select Query field.
The Instructions section includes further information.
The Pin Address and Pin Description can be customized for the item with the help of the Dynamic Tags button. In the mentioned fields, the corresponding custom fields should be connected.
Custom queries can also be used with the Query Loop available with Bricks. For instance, they can be applied to the Query Loop and filtered.
In the Query field, a “JetEngine Query Builder” Type should be selected.
Once the Type is set, the JetEngine Queries should be completed with a needed query.
That’s all about the Query Builder feature available as a part of JetEngine’s plugin functionality for your WordPress website.