I’ve managed to find the answer to my problem of empty custom fields showing on the page.
/** Get Fitness Custom Fields from listing page **/
add_filter( 'woocommerce_single_product_summary', 'something_custom_fields', 23 );
function something_custom_fields() {
//Get picture from post meta or template directory
$thumb = get_post_meta($post->ID,'Thumbnail', true);
$thumb = ( !empty( $thumb ) ) ? $thumb : get_bloginfo('template_directory').'/images/icon.png';
//Get checkmark for after each list item from template directory
$checkmark = get_bloginfo('template_directory').'/images/check.png';
//Define custom fields in this case with Genesis
$lista = genesis_get_custom_field('_something_field_type', $post->ID);
// The title of the section
echo '<div id="style_custom_fields"><img src="' . $thumb . '" />
<h2>Title</h2>';
// the rule to display items in foreach loop
if( $lista ) {
foreach( $lista as $key => $value ) {
// if value is nothing the display none
if( $value != '') {
echo '<li>' . $value . '<img src="' . $checkmark . '" class="checkmark-style" /></li>'; }
}
echo '</div>';
}
}