Stand with Ukraine. Fight for freedom and democracy

Donate
Back to contents

JetEngine: Query Builder Terms Query Type

Tutorial requirements:

  • JetEngine plugin installed and activated;
  • terms added to WordPress default categories or custom taxonomies built with JetEngine.

This overview will describe all the settings of Query Builder’s Terms Query type, which is a part of the JetEngine plugin.

Let’s take a look at its settings.

With the help of JetEngine functionality, you can display listings of terms, categories, and custom taxonomies. However, Query Builder provides a much more flexible tool for listing creation. Its Terms Query type allows you to choose precisely the terms or taxonomies you want to add to the list.

For instance, you can display related terms attached to the WordPress users with the help of the JetEngine Query Builder functionality.

Let’s take a look at its settings.

General

Here you can adjust the general options for the query you create.

the first part of the general tab of terms query type
  • Taxonomy — in this drop-down menu, you will see all your website’s taxonomies, both default and created with the JetEngine plugin. Choose the one you need among them;
  • Object/Post ID — if you type in the ID of posts, users, or other objects here, only the terms linked to those objects will appear on the list. 
  • Order By — in this drop-down menu, you can choose a parameter to sort out the terms:
    • Name — by the first letters of the term’s title;
    • Slug — by the first letters of the term’s slug;
    • Term Group — by the number of groups determined in the database;
    • Term ID — by digitsof term’s ID;
    • Description — by the first letters of the description’s first word;
    • Parent — by the first letters of the parent’s name;
    • Term Order — by the order in which the terms appear in the taxonomy tab of the dashboard;
    • By the number of objects associated with the term;
    • Match the order of the “Include” param — by the order that you set when adding IDs to the Include bar of the Include/Exclude tab;
    • Match the order of the “Slug” param — by the order that you set when adding slugs to the Slug bar of the Include/Exclude tab;
    • Order by meta clause — by the meta clause created in the Meta Query tab;
  • Order — it can be ascending (From lowest to highest values), which means from the smallest value to the biggest, or descending (From highest to lowest values) – from the biggest to the smallest;
  • Hide empty — if the item has no defined value, it won’t show up in the grid;
the second part of the general tab of terms query type
  • Show/Per Page Number — here, you can define how many terms will be shown in the grid simultaneously. Just type in the number. If you use the Pagination widget or block of the JetSmartFilters plugin, this will be the number of terms shown per page;
  • Total Query Number — the number you put here will be visible if you use the Query Count dynamic tag on the page. If you add the Pagination widget or block of the JetSmartFilters plugin, it will be the total number of found terms;
  • Offset —set the number of terms that won’t appear in the grid; this parameter will subtract terms from the beginning of the list.

Include/Exclude

With this tab, you can include and exclude the desired items to/from the query.

the first part of the include exclude tab of terms query type
  • Name — insert names of the terms here to be added to the list;
  • Slug — insert slugs of the terms here to be added to the list;
  • Include — type the IDs of terms here to be added to the list;
  • Exclude — type the IDs of terms that you don’t want to see in the list;
  • Exclude Tree — type the ID of the parent category here to exclude it and all its child terms from the list;
  • Search — search terms’ names and slugs for the words you put into this bar and add matching terms to the list;
the second part of the include exclude tab of terms query type
  • Name Like —  insert a word here, so Terms Query will search for terms with names that contain inserted word and add such terms to the list;
  • Description Like — Terms Query will search for terms with descriptions that contain inserted word and add such terms to the list.

Parent/Child

This tab includes all the settings concerning WordPress relations, parent, and child objects.

parent child of terms query type
  • Hierarchical — enable this toggle to include the categories that have some child terms in the list;
  • Child Of — insert the category’s ID here to add all its child terms to the list;
  • Parent —insert the category’s ID here to add all its direct child terms to the list and exclude all its grandchildren terms. If you type “0” here, all parent categories without their child terms will be attached;
  • Childless — only the taxonomies that don’t have child terms will appear on the list after enabling this toggle.

Meta Query

This tab allows adding the terms to the list according to the values of their meta fields. Set a value in the Value text area to compare it to the data from the meta field you choose in the Field key/name bar. If they match, the terms will appear on the list. The conditions the value of the meta field has to meet are called Meta Query Clause. You can add as many Meta Clauses as you want by clicking on the “Add New” button.

meta query tab of terms query type
  • Field key/name — enter the name of the meta field attached to the Taxonomy you’ve chosen in the General settings tab. You can use dynamic tags in this bar. Remember that you can also adjust the “Advanced settings” available once you push the dynamic tags button. Here, you can set Context and Fallback (e.g., type in “Not Found”) for the selected dynamic tag. However, mind that not all dynamic tags need these adjustments;
  • Value — set the value here to compare it  to the value of the meta field you have chosen in the Field key/name bar;
  • Compare — select parameters for values’ comparison:
    • Equal — displays terms having an equal value;
    • Not Equal — shows terms that don’t have an equal value;
    • Greater than — indicates terms that have a greater value. It works with numeric values only;
    • Greater or equal — displays terms that have a greater or equal value. It also works only for numeric values;
    • Less than — shows terms that have a lesser value. For numeric values only;
    • Less or equal — displays terms that have a lesser or equal numeric value;
    • Like — shows terms that have the value you set in the Value field mentioned in the content;
    • Not like — displays only the terms that don’t have the value you’ve put in the Value field mentioned in the content;
    • In the list — after you add several values to the Value field, it shows the terms that have at least one of them in their content;
    • Not in the list — displays terms that have any values except the ones you typed into the Value field;
    • Between — displays terms that contain the value between the two values set in the Value field; 
    • Not between — shows all the terms except the ones that have a value that matches the set interval;
    • Exists — indicates all the terms that contain the Key. You don’t need to set the Value in this case;
    • Not exists — displays all the terms that don’t include the Key. You don’t need to select the Value either;
    • Regexp — used to query items depending on the Checkbox and Radio meta field values; 
    • Not regexp — select this option to specify the Checkbox or Radio option to exclude it from the query;
  • Type — this drop-down allows you to specify what kind of data is in the chosen meta field:
    • Char — alphabetic data that is not case-sensitive;
    • Numeric — whole numbers only;
    • Date — date values (remember to enable the Save as timestamp toggle in the fields from where you get date values);
    • Datetime — date and time (remember to activate the Save as timestamp toggle in the fields from where you get date values);
    • Decimal — fraction number data;
    • Time — time values;
    • Binary — data that is case-sensitive;
    • Signed — whole numbers, both positive and negative;
    • Unsigned — whole numbers, only positive.
  • Clause name — if you give this Meta Clause a unique name, it will appear in the Order by drop-down, and you will be able to use it to sort the terms.

Geo Search

NOTE
This tab is available if you activate the Maps Listings feature in WordPress Dashboard > JetEngine > Modules.

Set the query depending on the geographical search by completing the following fields.

the first part of the geo search tab of terms query tab
  • Select location — set the point that will be the center one to get values around it later;
NOTE
Map in this field is shown depending on the provider you have picked earlier in the settings.
  • Address Field — complete the field with JetEngine meta field value. It can be either one meta field (Map meta field) that stores an address or two fields that include longitude and latitude. In the second case, separate two values by a comma.
the second part of the geo search tab of terms query type
  • Distance — fill in the radius to search around the selected center; 
  • Units — choose between “Miles” and “Kilometers.”

Also, you can find out how to set Geo Search based on the user location.

That is all for the Terms Query type of Query Builder. Create a precise terms list and display it wherever you want.