Help Center

How to Display Related Posts Using the Dynamic Field Widget

Discover how to display the related posts using the Dynamic Field widget from the WordPress JetEngine plugin.

Before you start, check the tutorial requirements:

This tutorial explains how to showcase related posts using the JetEngine WordPress plugin’s functionality within the Elementor editor.

Set Up the Relation

Following the How to Create Relations Between Posts guide, we set up a one-to-many relation between two Custom Post Types: “Departments” and “Doctors”. 

relation is created

You can use the relations you already have, or create a new one. Click the “Add/Update Relation” button once you are ready. 

Then, proceed to each parent post and connect the children’s posts. 

relations set up for posts

Click the “Save” button.

Display the Relations on the Front End

Now, proceed to the Single page template of the CPT (in this case, we use the “Department” Single page).

Add the Dynamic Field widget. 

Keep the “Post/Term/User/Object Data” option for the Source. In the Object Field, we select the “Children from relation”. Ensure you select the correct relation item — children or parents, depending on the single page where you need to display the posts. Additionally, mind selecting the correct relation, as there is a list of all the children from all the relations on your site, as well as a list of all the parents from all the relations. 

Then, turn the Filter field output toggle on and select the “Related posts list” Callback. In this case, we also keep the Add links to related posts toggle on. 

dynamic field set up

It is acceptable that the gray tab is displayed on the editing page instead of the values; the proper values will be shown on the front end. 

Click the “Publish” button once you are ready with the settings.

Check the Result

As a sample, we connected three “Doctors” posts to one “Department”.

relations set up for posts

When we proceed to the front end of this post, the same three posts are displayed. 

related posts displayed with a dynamic field on the front end

That’s it. Now you know how to display the related posts using the JetEngine WordPress plugin functionality.

Was this article helpful?
YesNo

Need help?

Ask Facebook community

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

Start a live chat

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