Support

Account

Home Forums Backend Issues (wp-admin) Show checkbox on user profile

Unread

Show checkbox on user profile

  • Hi,

    I would like to use the ACF checkbox option to show on the front-end user profile.
    I created a field group according to the documentation examples. Three checkboxes show on the back-end user profile page; Perfect!

    Now I want this to show on the front-end user profile as well. So that the user selects these checkboxes on the front-end and they show/correspondent with the checkboxes on the back-end.

    I now have the code below in the user-dashboard-profile.php but it shows a drop-down select screen. How do I fix this so it shows as checkboxes?

    Thanks in advance!

    <p>Favoriete steden: <?php echo implode(‘, ‘, get_field(‘favoriete_steden’)); ?></p>
    <?php
    $field_key = “field_5343cedec2d30″;
    $field = get_field_object($field_key);

    if( $field )
    {
    echo ‘<checkbox name=”‘ . $field[‘key’] . ‘”>’;
    foreach( $field[‘choices’] as $k => $v )
    {
    echo ‘<option value=”‘ . $k . ‘”>’ . $v . ‘</option>’;
    }
    echo ‘</checkbox>’;
    }
    ?>

Viewing 1 post (of 1 total)

The topic ‘Show checkbox on user profile’ is closed to new replies.