Home › Forums › Front-end Issues › Custom taxonomy slug not ID (again, i know) › Reply To: Custom taxonomy slug not ID (again, i know)
The code you posted is not getting the terms from the ACF field but with standard WP functions. You can do it that way.
If you’re using a radio field then it’s returning a single field and if it’s set to return the ID then….
$taxonomy = 'your-taxonomy'; // change this to your taxonomy $term_id = get_field('tecnica'); $term = get_term_by('id', $term_id, $taxonomy); echo $term->name;
It would be easier to return the term object, then you can just do
$term = get_term('tecnica'); echo $term->name;
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!
🤔 Curious about the ACF user experience? So are we! Help guide the evolution of ACF by taking part in our first ever Annual Survey and guarantee you’re represented in the results. https://t.co/0cgr9ZFOJ5— Advanced Custom Fields (@wp_acf) May 8, 2023
© 2023 Advanced Custom Fields.