Home › Forums › General Issues › Image Custom Field from CPT converted to Taxonomy › Reply To: Image Custom Field from CPT converted to Taxonomy
CPT-onomies has a weird structure as it forces a post as a taxonomy. To get the custom field, you need to pass the id of this post (the post that is converted to a taxonomy) as the second parameter. Something like this:
<?php $image = get_field('headshot', $cptonomies_post_id); ?>
where $cptonomies_post_id is the id of the post.
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 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.