I am trying to make my webpage display data in a custom meta field only if there is data to display. This is what I have right now.
I tried the following code, but the echo statement fails: the label 'State' doesn't display but the field data of 'genesis_custom_field('state')' shows up.
<?php
add_action( 'genesis_before_entry_content', 'state_meta' );
function state_meta() {
if(genesis_custom_field('state'))
{
echo '<br /><strong>State</strong>: ';
genesis_custom_field('state');
}
}
?>