Home › Forums › Front-end Issues › Get taxonomy list from acf value › Reply To: Get taxonomy list from acf value
Hi @Ron Willemse
The get_terms function will return an array of terms. This means you need to loop through the code and run your if statement for each term like so:
<?php
$terms = get_terms("shops");
if( $terms )
{
foreach( $terms as $term )
{
$value = get_field('shop_options', 'shops_'.$term->term_id);
if( $value == "option_1" )
{
echo 'something';
}
}
}
?>
Hope that helps
Thanks
E
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.