Croco Black Friday 2024 banner element
Copy discount code:
bfcroco2024
Days
Hours
Minutes
Croco Black Friday 2024 banner element
Help Center
How to Use Components in Query Loop or Listing Grid

How to Use Components in Query Loop or Listing Grid

This tutorial explains how to use components created with the JetEngine plugin in the Query Loop of the Bricks theme or Listing Grid on your WordPress website.

Before you start, check the tutorial requirements:

  • Elementor (Free version), Block editor (Gutenberg), or Bricks

  • JetEngine plugin installed and activated

The Components feature of the JetEngine plugin allows you to create a custom widget/element/block that can be reused on different pages or templates on your WordPress website. You can also add components to the JetEngine Listing Grid element/widget/block or Query Loop of the Bricks theme.

In this tutorial, we will create a component with user information and place it on the Listing Grid or Query Loop with posts. It can be default WordPress posts or posts from a Custom Post Type. Setting the component Context will display the author info for every post.

Create a New Component for CPT

Go to the WordPress Dashboard > JetEngine > Listings/Components tab and hit the “Add New Component” button.

add new component

In the Setup Component pop-up, enter the Component name (e.g., “User info”) and select the Component view (“Elementor,” “Bricks,” “Timber/Twig,” or “Blocks (Gutenberg)”).

In our example, we select the “Bricks” option.

Then, press the “Create Component” button.

component setup and creation

Check this tutorial to learn how to add meta fields to user and display user information.

To display some user data, we use Dynamic elements.

On the editing page, we place three Dynamic Field elements. For them, we set the “Post/Term/User/Object Data” Source and “Login,” “ID,” and “Email” Object fields.

dynamic fields display user info in bricks

Also, we enable the Customize field output option for three Dynamic Fields and set the Field format (e.g., “Email: %s”).

customize field output in bricks

To learn how to add the Content and Style Controls to the component, proceed to the Components Overview.

When you are done, save the component settings.

Component in Query Loop

To learn about the Query Loop feature of the Bricks theme, proceed to this article.

Go to the WordPress Dashboard > Pages tab and create a new page or edit the existing one in Bricks editor.

Here, press the “+” icon to add a new section and click on the Container element in the Structure tab on the right.

In the CONTENT settings tab of the Container, enable the Use query loop toggle and hit the “infinity” icon.

In the appeared pop-up, you can alter the query settings. For example, we adjust the Type to “Posts” and select the “Posts” option as the Post type, but you can set other options if you want to use another source for posts.

query loop settings

To close the pop-up, click on the area beyond it and fill the Container with the Query Loop with the needed content. For example, you can use Dynamic Elements.

For instance, we place such elements:

  • Dynamic Field with the “Post/Term/User/Object Data” Source and “Title” Object field;
  • Dynamic Field with the “Post/Term/User/Object Data” Source and “Content” Object field;
  • Dynamic Image with the “Post thumbnail” Source.
query loop with dynamic elements

In the left panel, search the recently created component by its name and place it on the editing page. In our case, it’s the User info.

component element in bricks builder

In the GENERAL settings tab, choose the “Current Post Author” option for the Component Context field. 

Be aware the first item in the Query Loop will show the current user instead of the post author, but it will work as intended on the front end.

Now, save the page settings.

component in query loop

Open the page on the front end and check the result.

component in query loop on the front end

Component in Listing Grid

Go to the WordPress Dashboard > JetEngine > Listings/Components tab and hit the “Add New Listing Item” button.

In the Setup Listing Item pop-up, we pick the “Post” Listing source and “Posts” in the From post type dropdown menu, enter the Listing item name, and select the Listing view (e.g., “Bricks”).

Then, push the “Create Listing Item” button.

Learn more about the Listing template in Elementor, Gutenberg, Bricks, and Timber/Twig.

creating listing template for posts

On the editing page, we place such elements:

  • Dynamic Field with the “Post/Term/User/Object Data” Source and “Title” Object field;
  • Dynamic Field with the “Post/Term/User/Object Data” Source and “Content” Object field;
  • Dynamic Image with the “Post thumbnail” Source.
listing item with post info

In the left panel, search the recently created component by its name and place it on the editing page. In our case, it’s the User info.

component in bricks editor

Open the General settings tab and select the “Current Post Author” option for the Component Context field. 

Note that the component will still show the current user information — the context will work as intended on the page with the Listing Grid.

Now, save the listing template settings.

component context option

Proceed to the WordPress Dashboard > Pages tab and create a new page or edit the existing one.

For example, we hit the “Add New Page” button, enter the page title, and hit the “EDIT WITH BRICKS” button.

edit with bricks

Drag-n-drop the Listing Grid element, widget, or block (depending on the builder you use) to the editing page and set the recently created Listing. Customize the element and page. Then, save the changes.

listing grid in bricks editor

That’s all. Now you know how to use components created with the JetEngine plugin in the Query Loop of the Bricks theme or Listing Grid on your WordPress website.

Was this article helpful?
YesNo

Need help?

Ask Facebook community

Get answers from 22K Crocoblock Community experts from all over the world.

Start a live chat

Ask question to support agent and share its details via chat messages.