Support

Account

Home Forums General Issues How can I apply an ACF field to a single custom post if it refers to the taxomy Reply To: How can I apply an ACF field to a single custom post if it refers to the taxomy

  • I tried like this but it didn’t work for me 🙁

    
    <?php 
    
    $category = get_the_terms($id, 'product_cat');
    $cater = $category[0]->term_id;
    //$taxonomy = 'product_cat';
    
    ?>
    
    <?php 
    if ( get_field( 'disable_finger', 'product_cat_' . $cater )):
    	?>
    <?php echo 'none';?>
    <?php else: ?>
           <div class="finger-size-wrap">
                        <select class="finger-size">
                            <option value="" selected="selected">Select finger size</option>
                            <?php for($i=3; $i<=10; $i=$i+0.5){
    						echo '<option value="'.$i.'">'.$i.'</option>';
    						}?>
                        </select>
                    </div>
    <?php endif; ?>