Cercando ho trovato questo codice online, secondo voi va bene o si può migliorare?
<?php if ( get_post_meta($post->ID,'sub header', true) ) { ?>
ID, 'sub header', $single = true); ?>" alt="<?php the_title(); ?>" />
<?php } ?>
<?php if ( !get_post_meta($post->ID,'sub header', true) ) { ?>
"/>
<?php } ?>