How to hide labels if no data returned
-
I am using WPUF and it is working fine. I have a form set up to create posts. In single.php, I use the following code to show data from the form in the post:
<?php echo get_post_meta( $post->ID, 'sale_benchmark_pricing_per_sq_meter', true ); ?>
Is there a way to get the labels for each form field to show IF there is form data returned? Currently I have my own labels within divs hard-coded in single.php as such:
<div>Sale Benchmark Pricing: €<?php echo get_post_meta( $post->ID, 'sale_benchmark_pricing_per_sq_meter', true ); ?> /sqm </div>
The problem is, if no data was entered into the form for this field, the hard-coded label still shows.
- This topic was modified 6 years, 6 months ago by .
- This topic was modified 6 years, 6 months ago by .
The page I need help with: [log in to see the link]
- The topic ‘How to hide labels if no data returned’ is closed to new replies.