Home › Forums › Front-end Issues › Recall the tags that have a connection to the posts with field taxonomy › Reply To: Recall the tags that have a connection to the posts with field taxonomy
I’m still not sure about your goal, so please forgive me if I’m wrong.
I’m afraid you need to use wpdb to achieve it. You can query it to get all of the tags set to the CPT like this:
SELECT * FROM wp_postmeta WHERE post_id IN (SELECT ID FROM wp_posts WHERE post_type = 'innovators') AND meta_key = 'taxonomy_field_name'
If you want to show the tags based on the custom posts, you need to loop the returned custom posts, get the taxonomy fields and put the IDs in one array. After that, you can use array_count_values() to count it.
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!