Back to contents

JetEngine: Query Builder Comments Query Type

This overview will describe all the Query Builder Comments Query type settings, which are a part of the JetEngine plugin.

Normally, you can’t take the comments left via the default WordPress commenting system and display them using Listing Grid. However, Comments Query of Query Builder functionality allows you that. Create a query for comments, use it to build a listing template, and afterward use it in the Listing Grid. 

Let’s take a look at the settings.

Include/Exclude

Comments Query include/exclude settings
  • Comment In. Type the IDs of comments here, separated by commas, and those comments will be added to the list;
  • Comment Not In. Here you can type the IDs of comments you want to exclude from the list. Separate them by commas;
  • Parent. This is a bar for a single value. If you have parent comments that have child comments attached to them, you can type the ID of the parent here. All the child comments will be added to the list;
  • Parent In. Here you can type several parent comments IDs, separated by commas. The children comments of all those parents will be added to the list;
  • Parent Not In. Type IDs of parent comments here and their child comments won’t be added to the list.

Author

Comments Query author settings
  • Author Email. Type the email address of the author here and all the comments he/she left will be added to the list;
  • Author URL. Insert author’s URL here and all the comments he/she left will be added to the list;
  • Author In. In this bar, you can add several authors by their IDs separating them with commas. All the comments they’ve left will be added to the list;
  • Author Not In. If you want to exclude comments of some authors from the list, type their IDs here, separated by commas;
  • Post Author In. When you type the ID of an author here, all the comments that were left under that author posts will be added to the list;
  • Post Author Not In. Type the ID of the author here and comments that were left to that author’s posts will be excluded from the list.

Meta Query

If you have a plugin that allows you to set meta fields for the comments, this tab will allow you to add the comments 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 comment 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 Query Clauses as you want by clicking on the “Add New” button.

Comments Query meta query settings
  • Field key/name. Enter the name of the meta field that is attached to the comments. 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 comments having an equal value;
    • Not Equal – shows comments that don’t have an equal value;
    • Greater than – shows comments that have a greater value. It works with numeric values only;
    • Greater or equal – displays comments that have a greater or equal value. It also works only for numeric values;
    • Less than – shows comments that have a lesser value. For numeric values only;
    • Less or equal – displays comments that have a lesser or equal numeric value;
    • Like – shows comments that have the value you set in the Value field mentioned in the content;
    • Not like – displays only the comments 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 comments that have at least one of them in their content;
    • Not in the list – displays comments that have any values except the ones you typed into the Value field;
    • Between – displays comments that contain the value between two, which are set in the Value field; 
    • Not between – shows all the comments except the ones that contain a value that matches the set interval;
    • Exist – shows all the comments that contain the Key. You don’t need to set the Value in this case;
    • Not exist – displays all the comments 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.

Date Query

Comments Query date query settings
  • Year. Posts that were created or modified in this year will be added to the list;
  • Month. Posts that were created or modified in this month will be added to the list;
  • Day. Posts that were created or modified on this day will be added to the list;
  • After. Posts that were created or modified after the date you enter into this bar will be added to the list;
  • Before. Type the date here, and all posts that were created or modified before it will be added to the list;
  • Inclusive. If you enable this toggle, the date you type in the After or Before will be included in the range;
  • Compare. Here you can choose how the date you added to Year, Month, and Day bars will be compared to the date of post creation or modification;
  • Column. You can choose which date to take in this drop-down menu – the date of creation or modification.

Pagination

This tab works as if the list of comments had pagination. However, you don’t need to add the Pagination widget or block to your Listing Grid. You add the comments that would be on the certain page of pagination if it were attached to the Listing Grid.

Comments Query pagination settings
  • Number. Here you can define the maximum number of comments that will be added to the list;
  • Paged. You can insert the number of the page in the pagination here. All comments that would’ve been on that page will be added to the list;
  • Offset. Here you can define how many of the first comments in the row won’t be added to the list;
  • Order By. Choose by what value to order the comments in a list;
  • Order. You can sort the comments From lowest to highest value or From highest to lowest.

Misc

Comments Query misc settings
  • Post Status. Comments of posts that have a status you choose here will be added to the list;
  • Post Type. Here you can choose the Post Type. Comments of all posts of that type will be added to the list;
  • Post Name. Insert a name of the post here, and all its comments will be added to the list;
  • Post Parent. Add an ID of the post that have child posts assigned to it and all the comments added to the child posts will be added to the list;
  • Search. You can write a word or several words here. The comments that contain that word in their content or title will be added to the list;
  • Status. By default, there are two possible statuses of the comment – “1” means that it is approved and “0” that it waits for approval. Type one of these numbers and all the comments of that status will be added to the list. If you have plugins that allow you to add some different status for comments, you can use it here too because the comment status is checked in the database table;
  • Type. This is a bar for a single value. Type the name of the comment type here and all the comments of that type will be added to the list. You can check for the comment types in the comment_type column of the wp_comments table in the database;
  • Type In. Insert names of the comment types here, separated by commas. Comments of those types will be added to the list;
  • Type Not In. Insert names of the comment types here, separated by commas. Comments of those types will be excluded from the list.

That is all for the Comments Query type. Create a good-looking list of comments and display it wherever you want!