Get result from Custom Field in Custom Post type

Ok, I got it work.

Since the checkbox for the custom fields stores entires as a comma seperated value, I needed to explode the delimiter and then perfom another loop to parse the information.

Then I created two separate arguments to split the data and call it back within the echo.

Here’s my final output of the code:

<?php
$mypost = array('post_type' => 'staff', 'posts_per_page' => 20 );
$loop = new WP_Query( $mypost );  
?>
<ul>

 <?php while ( $loop->have_posts() ) : $loop->the_post();?>

 <?php $items = get_post_meta( $post->ID, 'elements', true ); 

 foreach($items as $i) {

$loco = explode("," , $i['locations']);

    foreach ($loco as $l) {

        if ($l != 'local') {

            echo'<li>
                    <a href="https://wordpress.stackexchange.com/questions/123292/". get_permalink() ."https://wordpress.stackexchange.com/questions/123292/">
                <img src="https://wordpress.stackexchange.com/questions/123292/". wp_get_attachment_url( $i['small-image'] ) .'" />
                <h4>' . $i['staff-name'] . '</h4>
                <p>' . $i['short-title'] . '</p>
                ' . $i['3-areas-of-focus'] . '
                </li></a>
                ';
        }

    }
}
?>  

<?php endwhile; wp_reset_query(); ?>
<div class="clearfix"></div>

</ul>

I know this might not be the most elegant solution, but it’s working within my custom post types.