Dynamic ACF Relationship Fields Between 2 CPTs

Hello,

I’ve been searching and searching and can’t seem to figure out if this is possible or if I’m just not understanding any of the posts.

I have 2 custom post types: Actor Classes & Teachers

I’m creating the Actors archive page using the layout builder. The actor class subfields from a repeater come in fine (time, day, level, age), but the only field that doesn’t show properly is the “course_teacher” field which is a relationship (tied to the Teachers cpt).

In the “course_teacher” relationship subfield, I’m trying to pull the title from the Teachers cpt into the Actor Classes cpt. It pulls in and displays the post id numeral, but I can’t get it to show the post title string.

Is this even possible yet? If not, I’ll just switch it to a text field and manually enter names.

Thanks for your help!

Hi @mkench,

Thanks for reaching out!

You have the same concerns on this thread, please check the steps on how it is done:

Hope that helps and let us know how it goes.

HI,

Thanks for the quick response. I read that thread a lot yesterday trying to figure this out and tried it a million different ways. That testimonials example doesn’t seem to be a subfield in a repeater, though. Is that correct?

Hi @mkench,

Would you mind sharing your credentials so that we can check on your setup properly? To do that, please give us the following information in a Secure Note.

  • WordPress Login URL
  • Admin level username and password

You can find the Secure Note button at the bottom of your posts.

Thank you.

Secure note sent. Thank you for your time.

Hi @mkench,

I’ve been playing with the settings to find the right dynamic content to work with your relationship subfield. The reason why it is showing the post id not the post title is that you set your course teacher subfield return format to post id. In order for us to get the post title, I went ahead and change it to post object.

In your column 4 looper provider ( dynamic content ) it should be {{dc:looper:field key="course_teacher"}}

Then in your text element under your column 4, the right dynamic content to call the post title is {{dc:post:title}} and the text element should be set to looper consumer.

As you can see it is now showing the post title of your teachers.

Hope that helps.

Wow! Thanks a lot! I thought I tried that, but I guess I didn’t do it with all variations. I really appreciate your help with this.

Have a great day!

Hi @mkench,

You’re welcome and it’s our pleasure to help you! If you have any other concerns or clarifications regarding our theme features, feel free to open up a new thread.

Thank you.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.