Back to contents

Setting the Posts Query. How to use the meta query type for the listing grid

This tutorial explains which steps you have to take to use the meta query type for the listing grid with JetEngine plugin for the workflow with Elementor.

Query types give you a lot of flexibility with different types of data. In this tutorial, we will cover everything you need to know about the meta query parameters for the Listing Grid widget while working with the JetEngine plugin.

Let’s dive into the details!

Preparations

The first thing you should do is to create a listing with the type of content you want to be displayed. Save all the settings and let’s proceed to the direct steps.

Above all, you have to go to the Elementor editor, add the Listing Grid widget to the canvas and open the page where the listing is showed (how to perform these actions, read the tutorial).
Now, let’s start our work!

Settings in the JetEngine plugin

Step 1 – Open your WP Dashboard and go to the JetEngine > Meta Boxes option.

Add New Meta Box

Step 2 – Create a new Meta Box. In the General box you should set the name, and post types that you need (typically these are posts ones).

Step 3 – In the Meta Fields box, you should enter the title, ID and type. Click Add button to save the changes you’ve recently done.

Meta Field Settings

Meta query settings

Step 1 – Proceed to the Content > Post Query tab and choose the type – Meta Query one in the dropdown menu.

Step 2 – In the Key field enter the ID of the created (or existed one if you’ve created it previously) Meta Field. When we add the ID only, nothing is changed on our page. So that, follow the next step.

Step 3 – Type the Value in the corresponding field, for example, for the Meta field called ‘city’ the value might be ‘Lviv’ (or, ‘Kyiv’), like that.

Post Query Settings

Step 4 – If you have a single value, leave the ‘Equal’ operator, but if you’ve chosen multiple values, you should select ‘In’ operator (or any other one that goes with the text). ‘In’ type helps the system to look for the all values you’ve typed in the corresponding field.

Post Query Settings

Step 5 – Below in this tab select the corresponding type of the value for the content in the dropdown menu.

Step 6 – If you want to get value from the query variable, you need to paste the URL to the field and set the necessary operator.

How meta query works

Congrats!
We know how to use the meta query type for the listing grid with success!