Home › Forums › Front-end Issues › Problem returning post object data › Reply To: Problem returning post object data
Hi @colinf
That’s weird. If you put it inside The Loop, the returned value should be right. Did you add the code in an included file? If that’s the case, then you need to get the global $post
variable first like this:
global $post;
$post_object = get_field('instructor', $post->ID);
If that’s not the case, then could you please share the full template code you have? You can copy a long code to https://gist.github.com/.
Thanks 🙂
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.