WP Easy Post Types
How do I show field & label only if the field has a value (2 posts)

  1. gisselsson
    Posted 6 years ago #

    Hey There

    Thanks for a great plug in!

    I have one question though. How do you make it display a field and its label only if the field has a value?

    By using <?php the_ept_field('film_format'); ?>
    it displays the field label regardless if the user has entered a value into the field 'film_format'.

    Greatful for any help!


  2. chertz
    Plugin Author

    Posted 6 years ago #

    Right now you can use get_ept_field('film_format') before and check for emptiness, such as: if (!empty(get_ept_field('film_format')))

    In a future release we can add an option for "show label if not empty," but for right now this would be the workaround.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • WP Easy Post Types
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic