Support

Account

Home Forums General Issues Output Select label, based on page parent ID Reply To: Output Select label, based on page parent ID

  • Thanks for this.

    I’m still outputting nothing for the label though. With this block of code, I can happily output the $color_scheme_parent variable, which is the value set from the select list, but not the label:

    <?php
    /*
    *  Displaying a single value's Label
    */
    $field = get_field_object('color');
    $value = get_field('color_scheme_color');
    $label = $field['choices'][ $value ];
    ?>
    
    <p>Color label: <?php echo $label; ?> Parent color: <?php echo $color_scheme_parent; ?></p>