Home › Forums › General Issues › Post Object: get_post_meta › Reply To: Post Object: get_post_meta
The problem is that you are trying to get the permalink of the Cr3ativ Conference’s post object:
$cr3ativ_confspeakers = get_post_meta($post->ID, 'cr3ativ_confspeaker', $single = true); $speaker = get_post($cr3ativ_confspeaker); $speakerlink = get_permalink( $speaker->ID );
Which is not related to ACF at all. On the other hand, the code to get the post object is executed correctly:
$post_object = get_field('film_session');
This means that ACF is working correctly, but there’s something wrong with how you get the Cr3ativ Conference’s post object. I suspect there’s something wrong with the speaker ID:
get_permalink( $speaker->ID );
But it also could be anything else. For further and better support, I suggest you contact Cr3ativ Conference author instead.
I hope this makes sense 🙂
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 most recent ACF Chat Friday featured a live demo of how to register CPTs directly in the plugin, one of our most requested features. Check out the summary below for a replay of the demo, and don’t forget to register for the next session! https://t.co/k2KQ3WWBAz— Advanced Custom Fields (@wp_acf) March 9, 2023
© 2023 Advanced Custom Fields.