Support

Account

Home Forums Front-end Issues How to display custom post with acf fields from within repeater in flexible cont Reply To: How to display custom post with acf fields from within repeater in flexible cont

  • Hi @mastafu

    Thanks for the screenshots and explanation.

    You need to use get_field() instead of get_sub_field() when you try to get the field from a post object. You can also set the ID for the second parameter of get_field() to make sure it gets the right value. It should be something like this:

    <?php if( get_field('klasa_obrazka', $post->ID)): ?>
        <h5><?php the_field('klasa_obrazka', $post->ID); ?></h5>
    <?php endif; ?>

    I hope this helps.