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!
🚨 The 2023 ACF Annual Survey closes tomorrow! This is your last chance to complete the survey and help guide the evolution of ACF. https://t.co/0cgr9ZFOJ5— Advanced Custom Fields (@wp_acf) May 18, 2023
© 2023 Advanced Custom Fields.