WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. gisselsson
    Member
    Posted 3 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!

    http://wordpress.org/extend/plugins/easy-post-types/

  2. chertz
    Member
    Plugin Author

    Posted 3 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

About this Topic