,

ACF: Get Post Object data within a Repeater

18 Comments

  1. Thank you!!!

    1. My pleasure. I come back to this one from time to time. Today included.

  2. Bryan,
    Thanks. Just curious to see some live pages with advance layouts you\’ve made using acf 🙂

    1. Thanks for the link from your post Aksam. I\’ve been using ACF on nearly every project for a couple of years now. We tend not to get too complex – I never used the Flexible Content field for example. But it\’s times like this project posted here that minor complex items come up.

      1. Thanks. I didn\’t know about Flexible content field. Looks like its a page builder like plugin. good to know options like these exist. You never know when you will need them.

        I came across this repeater field issue when i was developing the custom post for this page design
        http://colombotraders.com/demo/infinity/draft2/tour-details-page.html

        What do you think about this design? I\’ve not developed a post type this advance before, so I\’m wondering how it will work in a live environment.

        So far, I have already developed the custom post page except for the slider. It\’s working nicely on my local wamp server. The custom post type has about 10 custom fields including a textarea to save google my map code, another to save slider code, a post object field, few other normal fields and 3 repeater fields each with several sub fields.

      2. Looks like a fun layout to build. Custom post types and custom taxonomies!

  3. Thank you very much!! Worked perfect. 🙂

    1. No problem, glad you got it working 🙂

  4. jas

    might want to close your #slider div?

    1. Whoops, yep definitely @jas, thanks.

  5. Steve

    Hello,
    i have post object called project_for_apartment. Then i have repeater called facility_fac. Inside repetear i have subfield called feature_value. I cant manage for days to extract those values on my custom template.

    1. Did you get this sorted out Steve? Go ahead and post your code and we\’ll see if we can sort it out.

  6. Douglas Ward

    Years later, but still saving the day. Thank you!

    1. I’m glad to know this still works and you found it useful Douglas!

  7. andrew

    Hey thanks for the tip! Unfortunately I’m only getting one of my repeater values printed. Narrowed it down to the while loop failing after the first post prints. Any ideas why that may be?

    If I kill the and just enter random characters they will print the number of times that the while loop executes. However, with the post object assignment in there it will only loop once.

    1. Hi Andrew. If you could post your code somewhere I might be able to troubleshoot.

  8. YES! This was perfect for what i needed! thank you very much!

Leave a Reply

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