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.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.