Support

Account

Home Forums ACF PRO Want to wrap field group link

Solving

Want to wrap field group link

  • Hi

    i want Display Value via checkbox – Yes / No

    Use Coupon Code ‘the_field’

    When Checked ‘Yes’ Its display Value
    But When ‘No’ its showing ‘Use Coupon Code’

    echo '<div class="discount_bar">';
    		// echo '<div>'.the_field('test_field_').'</div>';
                    echo '<span> Use Coupon Code </span>'; 
    		echo '<a class="selectcoupon" href="#couponlink" target="_blank" >'; 
    		echo ''.the_field('coupon_code').''; 
    		echo '</a>';  

    If Checkbox Yes – Should Display this whole , If unchecked hide whole

    Use Coupon Code Display Coupon Value

    Thanks

  • is this a checkbox field or a true/false field?

  • 
    if (get_field('checkbox_field_name')) {
      echo '<div class="discount_bar">';
    		// echo '<div>'.the_field('test_field_').'</div>';
                    echo '<span> Use Coupon Code </span>'; 
    		echo '<a class="selectcoupon" href="#couponlink" target="_blank" >'; 
    		echo ''.the_field('coupon_code').''; 
    		echo '</a>';
                    echo '</div>';
    }
    
Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.