how do i hide the whole "Conditions: " if the field is empty? i cannot seems to figure out and the code i tried are invalid
echo '<span class="sku">Conditions: ' . get_post_meta( $product->id, '_conditions', true ) . '</span>';
Thanks so much!
how do i hide the whole "Conditions: " if the field is empty? i cannot seems to figure out and the code i tried are invalid
echo '<span class="sku">Conditions: ' . get_post_meta( $product->id, '_conditions', true ) . '</span>';
Thanks so much!
Maybe try this:
if(!empty(get_post_meta( $product->id, '_conditions', true ))){
echo '<span class="sku">Conditions: ' . get_post_meta( $product->id, '_conditions', true ) . '</span>';
}