Support

Account

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