• I have custom fields in my database and some are blank. I want to integrate the fields into my blog’s template so each is displayed based on what is saved. Have that part figured out:

    <il class=”socialimg”><img src=”IMGURL” height=”36″ width=”36″></il>

    The issue I can’t figure out is the code I need to HIDE the fields on a post that have custom fields that are blank. Any ideas? This is the code I’m working with right now (what’s missing or wrong?) IMG URL is an actual URL in my code.

    <?php if ( get_post_meta($post->ID, ‘customfield_01’, true) ) { ?>ID, “customfield_01″, $single = true); ?>”><img src=”IMG URL” /><?php } ?>

    The posts I’m using are custom taxonomies labeled as “Locations” if that helps.

  • The topic ‘Help Hiding Custom Fields That Are Empty?’ is closed to new replies.