custom fields ckeckboxes - output checked items as list

How can I output the checked elements of a checkbox custom field as list elements, or wrap each in any html element ?

  • PC
    • WPMU DEV Initiate

    Hello there,

    Greetings and thanks for posting on the forums.

    You will need to do some custom work and edit the core files in order to change the way they are displayed.

    ui-admin/custom-fields.php & ui-admin/display-custom-fields.php are the HTML of those files can be edited to change the layout

    Cheers
    PC
    Sales &Support

  • urbancube
    • New Recruit

    Thank you for your anwer. However, it appears my question wasn't clear enough.
    I wanted to output the result of the checkbox field as a list on my template page.
    I ended up doing it this way :

    <ul>
    	<?php
    	$checkbox = get_post_meta( $post->ID, "_ct_checkbox_51e507f032240", true );
    	$output = '';
    	foreach ($checkbox as $item) { ?>
    		<li><?= $item ?></li>
    	<?php } ?>
    </ul>

    Cheers

  • PC
    • WPMU DEV Initiate

    Hiya,

    Thanks for posting back.

    Glad you got this sorted out :slight_smile: I got confused on what you were trying to ask :stuck_out_tongue: lol

    Sent you a few points for sharing your solution with the community !

    Cheers
    PC
    Sales &Support

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.