ACF "Post Object" fields on Single Layout

Hi, I’ve read a bunch of similar topics on the forum, but they all seem more complex than what I’m trying to accomplish.

I have a Custom Post Type called “Instructors” and another CPT called “Classes.”

When creating a new Class, the user can select one or more “Instructors.”

I am now creating a Single Layout using the Layout Builder in Cornerstone. Using the assignment conditions, I’ve associated the layout with the Class CPT, and I’m displaying other ACF fields just fine. However, I want to display the Instructors, so I’ve used {{dc:acf:post_field field=“instructors”}}, but it doesn’t seem to work. The dynamic content in that area is just blank.

So, how do I get the value of the “Post Object” fields to display?

Hey @dannikb,

Thanks for reaching out!

Please make sure that the return format of your post object field to post object. A good example is on this thread.

If it doesn’t help, we need to investigate it further, 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.

Yep, the ACF is setup to return Post Object, but with no luck. Sending a secure note.

Hey Danni,

I’ve check your website but I couldn’t see any Classes CPT. I also don’t see any post objects in your ACF. Please add all necessary items so that we can check it for you. If that’s not the case, please let us know how we can see it.

Thank you.

I’m sorry … I was moving too fast, clearly. The CPT name I gave was an example. It’s actually called “Programs,” and it has two (relevant) ACF fields – Instructor(s) and Venue, each of which are “Post Object” type and link to other CPTs by those same names.

Hello @dannikb,

You will have to use the Relationship instead of the Post Object field type in your custom ACF field.

You should then be able to use Looper Provider Dynamic Content to display the items for the instructors and venues. Please check out this documentation:

Hope this helps.

Well, that seems to have gotten me somewhat closer except for two things:

  1. When I went back into edit today, my entire Single Layout was gone. I’m not sure what happened, but I’m having to recreate it from scratch.
  2. As I recreate it, I still cannot figure out how to get this to work. The directions in that article are good up until you get to the point where you’re setting up the Looper Consumer. It’s using an example with images from a different post type (users), and I just get totally lost. I have the Provider setup correctly (I think) but I can’t figure out what dynamic content to put into the Consumer.

Hello @dannikb,

The video demo utilized the Users object. In your case, it will be different because you have created the “Instructors” as a new custom post type. You will have to treat it like a post. Your Looper Provider Dynamic Content will return a custom post type object so you can just use the featured image and the title to display the instructor details.

Screenshot 2023-03-19 at 10.12.46 AM

Hope this makes sense.

Hi, So, I’m really starting to get a bit freaked out here. You guys have logged in to look at this twice, and each time you do, when I go back the next day, the entire Cornerstone template is gone. It’s just blank. What is happening to my template?

Hello @dannikb,

When I logged in to check your ACF field and your Looper settings, all your layouts are still there. That is why I was able to make some example screenshots for you. Sadly, I could not check it again since we no longer have access to your staging site. Please go to Cornerstone > Settings > System and clear the system caches.

Kindly let us know how it goes.

Yep, that’s what so weird. You logged in and took screenshots. When I logged in the next day, everything was gone. That happened twice in a row. The first time, I thought maybe I had accidentally deleted it (I had made a copy and deleted the copy). So I recreated part of it and asked my follow up question.

But then it happened again the next night, so I revoked your access.

Everything is there this morning, after I removed the Themeco user, so I don’t think that it was something I was doing. I’m not sure if it’s a bug or a mistake, but I’m concerned either way.

Hey Danni,

I suspect that when someone edits the page, you also edit the page that’s why the template is gone but it is just an assumption. We are also not quite sure about what’s going on. On the other hand, have you been able to accomplish the ACF relationship?

Please le ut know.

Well, that’s a bit concerning if two people editing the template causes the entire thing to be deleted! Can we look into this, because I think that’s a pretty major bug if that’s the case. However, I’m skeptical that’s the case since the responses I received were in the middle of the night of my time zone, so I know I wasn’t in the template editing it. I suppose it’s possible I had it open, but it would have been saved.

I did get the other issue figured out, so thank you for that.

Hey Danni,

We’re glad that you’re able to figure it out! 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.