• Resolved De Murph

    (@de-murph)


    I have a set of checkboxes (custom field), which outputs as an array by using get_post_meta().

    Is there a way to iterate through the array and display the values, comma separated? Please help!

Viewing 3 replies - 1 through 3 (of 3 total)
  • <div class=”copy”><?php echo c2c_get_custom(‘yOuRliSt’, ‘<b>List of things: </b>’, ”, ”, ‘, ‘); ?></div>

    Moderator Samuel Wood (Otto)

    (@otto42)

    www.remarpro.com Admin

    Why do people always think you need that “c2c_get_custom” plugin? You don’t.

    De Murph: To iterate through an array of something, use foreach. Like this:

    $demo = array('aaa','bbb','ccc');
    foreach ($demo as $value) {
    echo '<li>'.$value.'</li>';
    }

    Thread Starter De Murph

    (@de-murph)

    Thanks guys.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Please help: how to iterate through Custom field array?’ is closed to new replies.