ACF looper in CPT to display specific posts from CPT

Hello,

can you help me to set up a display of posts inside custom post type post?

Situation is this:

I have CPT usluge and created couple of posts. Inside one of those posts I used your provider-palooza element and tried to connect it with the ACF element to select posts and display them.

I don’t know where is the problem with the looper provider.

Hey Ofir,

Thanks for reaching out!

Upon checking your setup, you should lower the priority of your Single layout Usluga- medicine rada for the layout to work because currently, both single layouts have the same priority number of 0. That being said, I highly suggest changing it to -1.

Here is our online documentation that explains more about priority:

Hope that helps.

Hello,

I did that but the element still doesn’t query posts from that CPT.

So I’m not sure if the problem is still set up of the looper provider and consumer.

Best regards

Hello,

any other advice I can try? Still can’t figure out why when I set looper provider to be a repeater field for ACF object, nothing can be pulled from selected data inside CPT.

Hey Offir,

Upon checking your setup, I am unsure about the flow on this one. That being said, would you mind sharing more information on how it should work? Providing screenshots or videos is a great help.

Thank you.

Hello,

will do.

I have CPT called Usluge and inside there are some posts. All of those posts except one have a single layout template but Medicina rada post has a slightly different layout that I assigned to that post. As I said, they are all under the same CPT.

Next thing I did was to create a repeater field with an object field so I can in Medicina rada post select other posts from CPT Usluge.

Inside single layout Usluge - Medicina rada I used provider-palooza element from design cloud and I can show those selected posts if I use query builder.

Screenshot 2024-01-26 at 10-36-35 Usluga - Medicina rada - Single Layout - Cornerstone

But as soon I change the looper provider to dynamic content to call the repeater field I don’t get those posts.

The same thing happens when I try to call them on the homepage.

So I’m not sure if I didn’t set up the correct looper provider and consumer or maybe it’s not possible to do what I wanted to achieve.

Best regards

Hello Ofir,

You will have to create a nested looper before you can display the ACF Relationship field. Kindly check out this example looper structure:

Looper Provider Query Builder (Usluga - medicina rada)
    Looper Consumer 
      Div element as a Container
          Looper Provider Dynamic Content (use the {{dc:acf...... }})
              Looper Consumer 

It is best that you check out these videos as well:

Hope this makes sense.

Hello,

I still have problem accessing selected fields. Can you please look at homepage under popis usluga test my setup and why it loopes all posts and not selected ones?

Best regards,

Hello,

is it possible to check my setup for loopers?

Best regards

Hey Ofir,

Your element structure should be like this first:

You can then run a nested Looper Provider Dynamic Content in your Grid element and use the Cell element as the Looper Consumer. Add a Headline and Text element to display the titles and other post-item details. And by the way, if nothing displays, please check the return format of your repeater. You can play around with the Post Object or just the Post ID.

Cheers.

Hi,

I tried to recreate that but can’t figure out how it should work.

Either I get all posts from Usluge cpt or I don’t get any.

Hey @ofirdoo,

Instead of using the ACF post object, can you please try using the ACF relationship and follow the recommendation by my colleague above.

Looper Provider Query Builder (Usluga - medicina rada)
    Looper Consumer 
      Div element as a Container
          Looper Provider Dynamic Content (use the {{dc:acf...... }})
              Looper Consumer 

Question about your ACF structure, do you really need to have an ACF repeater then post object? I am asking this one because,in ACF relationship, you can select multiple items.

Hope that helps and let us know how it goes.

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