Support

Account

Home Forums Front-end Issues How show input checkbox in page template Reply To: How show input checkbox in page template

  • Firstly, your choices need to be like this

    
    1 : Label for 1
    

    Please note the space on both sides of the colon

    2 you need to set the return value to return the value and the label in and array

    Then you need to follow the documentation https://www.advancedcustomfields.com/resources/checkbox/

    and you need to supply the user for the user that you want to show when your getting the field https://www.advancedcustomfields.com/resources/how-to-get-values-from-a-user/

    
    $subs = get_field('field_name', $post_id);
    if ($subs) {
      ?>
        <ul>
          <?php 
            foreach ($subs as $sub) {
              ?>
                <li><?php echo $sub['value'],': ',$sub['label']; ?></li>
              <?php 
            }
          ?>
        </ul>
      <?php 
    }