How to Display ACF Relationship & Reverse Relationship in Dynific Addons for Elementor

To display ACF relationship and reverse relationship data in Elementor without code, use the DA – Post Blocks Adv widget in Dynific Addons for Elementor. Set its query source to Relationship and enter the field name to show related posts, or turn on its reverse relation option to show posts that link back to the current one.

This tutorial uses a movie listing site with two post types, Movies and Cast. Each movie page shows its cast, and each actor’s page shows every movie they appear in, built entirely in Elementor.

Key takeaways

  • A direct relationship shows the posts you picked in a Relationship field, such as the cast of a movie.
  • A reverse relationship shows the posts that point to the current one, such as every movie an actor appears in, without filling in a second field.
  • DA – Post Blocks Adv in Dynific Addons for Elementor displays both as a grid, carousel or accordion, with no code.

What Is an ACF Reverse Relationship?

An ACF reverse relationship shows the posts that point to the current post through a Relationship field. If each movie has a Related Cast field listing its actors, the movie page shows a direct relationship, and the actor page can show a reverse relationship: every movie whose Related Cast field includes that actor.

Suppose we are creating a movie listing website with two post types: Movies and Cast. Some custom fields are assigned to the Movie post type, like release date, duration, and an ACF Relationship Field type “related cast.” The Movie detail page will display information related to the movie, also the Cast detail that has worked on it based on the Relationship field type we have created.

The post under the Cast post type will give information about the actors, including name, image, and a list of movies they have acted in. The relationship between actors and movies is achieved using a reverse relationship, as there is no direct relationship between the cast and the movies. Later in this tutorial, you will see how we can get post data by applying reverse relationships.

How Do You Set Up the ACF Fields for This Example?

To set up the fields, create two custom post types, Movies and Cast, add a field group with a Relationship field that links movies to cast members, and fill in a few posts. Everything in this section uses the free Advanced Custom Fields plugin.

Create the Movies and Cast Post Types

Create two post types in ACF, Movies and Cast, then add a few posts to each. Our ACF beginner guide shows how to create custom post types and field groups step by step.

Create Custom Post Types in ACF
Create Custom Post Types in ACF

Add the custom fields and the Relationship field

Create a field group with fields such as Release Date and Rating, then add a Relationship field called Related Cast. In its settings, set the post type filter to Cast so editors only see actors in the list, and set Return Format to Post ID, which the reverse query later in this tutorial needs. The default is Post Object.

Create Field Group in ACF and add Relationship Field
Create Field Group in ACF and add Relationship Field

Set the field group’s location rule to the Movies post type, so the fields appear on every movie.

Adjust Location Rules Settings ACF
Adjust Location Rules Settings ACF

Fill in the fields

Open each movie, fill in its details and pick the cast members in the Related Cast field. Then design a block layout, which controls how each related post looks when it is displayed.

Add Data For Movie
Add Data For Movie

Design the block layout

Create a block layout in DA Templates for one related item, such as an actor card with a photo and name. You can design one layout for both templates or a separate one for each. The block layout documentation covers the settings.

Block Layout
Block Layout

Dynific Addons for Elementor

Want Related Posts on Every Template Without Code?

Show relationship and reverse relationship data as a grid, carousel or accordion with DA – Post Blocks Adv, using block layouts you design in Elementor.

How Do You Display ACF Relationship Data in Elementor?

To display ACF relationship data in Elementor, create a single post template for Movies in DA Templates, add the DA – Post Blocks Adv widget, choose your block layout, and set the query source to Relationship with the field name related_cast. Each movie page then shows its own cast automatically.

Create the Movies single post template

Go to Dynific Addon Templates > Add New. Set Render Mode to Post Template and Post Type to Movies, pick a movie as the Preview Post so the editor shows real data, and tick Auto Apply to use the template on every movie. Then click to edit it in Elementor.

Create Single Post Template in DAPro
Create Single Post Template in DAPro

Show the movie’s own details, such as the release date and rating, with the DA – ACF Fields widget.

DA: ACF Fields
DA: ACF Fields

Show the cast with DA – Post Blocks Adv

  1. Add the DA – Post Blocks Adv widget where the cast should appear.
  2. Under Skin, choose Carousel, Grid or Accordion.
  3. Under Block Layout, select the layout you designed.
Post-Blocks Adv Settings
Post-Blocks Adv Settings
  1. In the Query section, set Source to Relationship.
  2. Enter related_cast in the Relationship Field setting.
DA - Post Blocks
DA – Post Blocks

Each movie page now shows its cast in the layout you chose.

Final Look of Display Relationship Field
Final Look of Display Relationship Field Data

How Do You Display Reverse Relationship Data Without Code?

To display reverse relationship data, create a single post template for Cast, add DA – Post Blocks Adv, set the source to Relationship with the same field name, and turn on the reverse relation option. Each actor page then lists every movie whose Related Cast field includes that actor, with no extra field to fill in.

Create the Cast single post template

Go to Dynific Addon Templates > Add New again. Set Render Mode to Post Template and Post Type to Cast, choose an actor as the Preview Post, tick Auto Apply, save, and edit the template in Elementor.

Create Single Post Template For Reverse Relation
Create Single Post Template For Reverse Relation

Add widgets such as DA – Post Title and DA – Content to show the actor’s name, photo and biography.

Block Layout
Block Layout

Show the actor’s movies with a reverse query

  1. Add the DA – Post Blocks Adv widget.
  2. Under Skin, choose a layout, and under Block Layout, select your layout.
DA: Post-Blocks Advanced
  1. In the Query section, set Source to Relationship and enter related_cast in the Relationship Field setting, just as in the Movies template.
  2. Turn on the Reverse Relation option, because the link is stored on the movies, not on the actor. This only works when the ACF field’s Return Format is set to Post ID.
DA: Post Blocks Reverse Relationship
DA: Post Blocks Reverse Relationship

Each actor page now lists every movie they appear in.

Reverse Relationship
Reverse Relationship

For every setting, see the documentation on displaying ACF relationship fields and displaying ACF reverse relationships with Post Blocks Adv.

Dynific Addons for Elementor

Turn your custom fields into real page layouts

Display ACF fields, repeaters and other dynamic content in Elementor without writing code.

What Should You Do Next?

Start with one Relationship field between two post types, display it on the first post type’s template, then add a reverse query on the second. The same steps work for products and related products, courses and lessons, or services and team members.

Dynific Addons for Elementor handles both directions from the Elementor editor, so related content stays up to date on every template without touching code.

Frequently Asked Questions

What is an ACF Relationship Field in WordPress?

The ACF Relationship field links one post to one or more other posts, such as a movie to its cast. Editors pick the related posts from a searchable list, and the links can then be displayed on your site, for example as a cast carousel on each movie page.

What is a reverse relationship in ACF?

A reverse relationship shows the posts that link to the current post, even though the link was made on the other side. If each movie lists its cast, the reverse relationship lets an actor’s page show every movie that lists that actor.

Do I need ACF Pro to use Relationship Fields?

No. The Relationship field is part of the free Advanced Custom Fields plugin, and the Bidirectional setting added in ACF 6.2 is free too. Displaying the data without code in Elementor uses Dynific Addons for Elementor.

What is Dynific Addons for Elementor used for?

Dynific Addons for Elementor, formerly AnyWhere Elementor Pro, lets you build dynamic templates in Elementor and display custom field data, including ACF Relationship, Repeater and Flexible Content fields, without writing code.

Should I use a reverse query or ACF’s Bidirectional setting?

Both show the same links from the other side. A reverse query in DA – Post Blocks Adv reads the existing field, so you do not need a second field. ACF’s Bidirectional setting stores the link on both posts, which also helps other tools that read the field. Our ACF Relationship field guide explains the setting.

Leave a Reply

Your email address will not be published. Required fields are marked *