Home Forums Plugin Support WP User Frontend Pro Any way to hide meta field not filled?

This topic is: resolved

Tagged: , ,

This topic contains 3 replies, has 2 voices, and was last updated by  Tareq Hasan 5 years, 9 months ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #3024

    s.pezzani
    Participant
    Post count: 36

    Hello Tareq,

    I've inserted into post template some codes to show meta field like these:

    <?php echo get_post_meta( $post->ID, ‘name1', true ); ?>
    <?php echo get_post_meta( $post->ID, ‘name2', true ); ?>

    There's some way to hide in post page this field if they aren't filled by user?

    Thank you.

    #3025

    Tareq Hasan
    Keymaster
    Post count: 2831

    You can use it like that –

    <?php
    if( $name1 = get_post_meta( $post->ID, 'name1', true ) ) {
        echo $name1;
    }
    ?>
    
    #3031

    s.pezzani
    Participant
    Post count: 36

    Wow! Thank you Tareq for your kindness.

    And congratulations again for this amazing plugin.

    #3032

    Tareq Hasan
    Keymaster
    Post count: 2831

    Would you be able to give us a testimonial?

Viewing 4 posts - 1 through 4 (of 4 total)

The topic ‘Any way to hide meta field not filled?’ is closed to new replies.