WordPress global variables?

Meta data is save in postmeta table and to get them you can use get_post_meta($post_id,’meta_key_name’,true); so in your shortcode function globilaize $post object and get you value like that if($something == “value”) { global $post; $one = get_post_meta($post->ID,’value_name’true); $two = get_post_meta($post->ID,’value2_name’true); }

conditionally echo in meta box data loop

$val will never == ” here, because $val is holding your field name, not the data. also, use get_the_value to have it returned, the_value will just echo the data out. foreach ($values as $val) { if ($artinfo_mb->get_the_value($val) != ”){ $artinfo_mb->the_value($val); echo ‘<br />’; } }