Home › Forums › Front-end Issues › Problem returning post object data › Reply To: Problem returning post object data
Yes, I’m using this inside of a loop. Adding a proper post id returns the right result.
Now how would I get the proper post id for each item in the loop and return the title and link? I assume it would look something like:
<?php $post_object = get_field('instructor', $post->ID); ?>
<p><a href="<?php echo get_permalink($post_object->ID); ?>"><?php echo $post_object->post_title; ?></a></p>
… but that doesn’t work.
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.