Home › Forums › General Issues › Fields from Custom Taxonomy on Single.php › Reply To: Fields from Custom Taxonomy on Single.php
So I found at least a solution to get the fields from the “first” taxonomy.
It’d be great if someone could tell me how to randomize this!
<?php
global $post;
$terms = wp_get_post_terms($post->ID, 'movies', array('fields' => 'ids'));
//print_r($terms);
echo $terms[0];
?>
<?php echo get_field('director', 'movies_'.$terms[0]); ?>
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.