With the help of JetEngine functionality, you can display listings of terms, categories, and custom taxonomies. You can even query that terms using the Terms Query settings section of the Listing Grid widget or block. However, Query Builder functionality provides you with a much more flexible tool for listing creation. Its Terms Query type allows you to choose precisely the terms or taxonomies you would like to add to the list.
Let’s take a look at its settings.
- Taxonomy. In this drop-down menu, you will see all taxonomies that your website has, 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 that are linked to those objects will be added to the list;
- Order By. In this drop-down menu, you can choose by which parameter the terms will be sorted:
- Name – by the first letters of term’s title;
- Slug – by the first letters of term’s slug;
- Term Group – by the number of groups determined in the DataBase;
- Term ID – by numbers of 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 are shown 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 that can be 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 be shown in the grid;
- Show/Per Page Number. Here you can define how many terms will be shown in the grid at the same time. Just type in the number. If you use the Pagination widget or block of 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 somewhere on the page. If you add the Pagination widget or block of JetSmartFilters plugin, it will be the total number of found terms;
- Offset. When you type the number into this bar, that number of terms that go first in the list won’t be shown in the grid.
- Name. Insert names of the terms here and they will be added to the list;
- Slug. Insert slugs of the terms here and they will be added to the list;
- Include. Type the IDs of terms here and they will be added to the list;
- Exclude. Here you can type the IDs of terms that you don’t want to see in the list;
- Exclude Tree. If you type the ID of the parent category here, both it and all its child terms will be excluded from the list;
- Search. It will search terms’ names and slugs for the words you put into this bar and add to the list those that have a match;
- Name Like. Terms Query searches through the names of terms and if it finds a match with the word you type in here, it will be added to the list;
- Description Like. Terms Query searches through the descriptions of terms and if it finds a match with the word you type in here, it will be added to the list.
- Hierarchial. If you enable this toggle, the categories that have some child terms will be included in the list;
- Child Of. Type in the ID of a category here and all its child terms will be added to the list;
- Parent. Type in the ID of a category here and all its direct child terms (this means that grandchildren won’t be added) will be added to the list. If you type “0” here, all parent categories without their child terms will be added to the list;
- Childless. After enabling this toggle, only the taxonomies that don’t have child terms will be added to the list.
This tab allows you to add the posts to the list according to the values of their meta fields. You set a value in the Value text area, and then the data from the meta field that you choose in the Field key/name bar is compared to that value. If they match, the post is added to 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.
- Field key/name. Enter the name of the meta field that is attached to the Post Type you’ve chosen in the General settings tab. You can use dynamic tags in this bar;
- Value. The value you set here will be compared to the value of the meta field you have chosen in the Field key/name bar;
- Compare. Here you can choose how the values will be compared:
- Equal – displays posts having an equal value;
- Not Equal – shows posts that don’t have an equal value;
- Greater than – shows posts that have a greater value. It works with numeric values only;
- Greater or equal – displays posts that have a greater or equal value. It also works only for numeric values;
- Less than – shows posts that have a lesser value. For numeric values only;
- Less or equal – displays posts that have a lesser or equal numeric value;
- Like – shows posts that have the value you set in the Value field mentioned in the content;
- Not like – displays only the posts that don’t have the value you’ve set in the Value field mentioned in the content;
- In the list – after you add several values to the Value field, it shows the posts that have at least one of them in their content;
- Not in the list – displays posts that have any values except the ones you typed into the Value field;
- Between – displays posts that contain the value between two, which are set in the Value field;
- Not between – shows all the posts except the ones that contain a value that matches the set interval;
- Exist – shows all the posts that contain the Key. You don’t need to set the Value in this case;
- Not exist – displays all the posts that don’t contain the Key. You don’t need to set the Value either;
- Type. This drop-down allows you to specify what type of data is stored in the chosen meta field:
- Char – alphabetic data that is not sensitive to case;
- Numeric – whole numbers only;
- Date – date values;
- Datetime – date and time;
- Decimal – fraction number data;
- Time – time values;
- Binary – data that is sensitive to case;
- 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 posts.
That is all for the Terms Query type of Query Builder. Create a precise terms list and display it wherever you want!