The checkbox field creates a list of tick-able options. This field is useful to add categories or other information to your post or page.

Creating a checkbox field

The checkbox field contains options to customize your field:

  • Choices: You can populate the tick-able list with choices. Each choice is entered on a new line. Each choice requires a value and a label which are broken by a ‘:’. If no ‘:’ is found, the field will use the Label as the Value.

Edit screen

Template usage

The checkbox field will return an array of selected choices. Either use the get_field() function to obtain this array, or use the_field() to simply ouput a coma separated list.

Basic output

<p>Color: <?php the_field('field_name'); ?></p>

Custom output


$field = get_field_object('field_name');
$value = $field['value'];
$choices = $field['choices'];

if( $value ): ?>
	<?php foreach( $value as $v ): ?>
		<?php echo $choices[ $v ]; ?>
	<?php endforeach; ?>
<?php endif; ?>

Basic logic


$selected = get_field('field_name');

if( in_array('red', $selected) ) {
	echo 'Red was selected!';


Query posts


$posts = get_posts(array(
    'meta_query' => array(
            'key' => 'field_name', // name of custom field
            'value' => '"red"', // matches exactly "red"
            'compare' => 'LIKE'

if( $posts ) {