I have Custom Fields associated with a Custom Post Type. My CPT is “Positions’ as in Job Positions.
Not all Custom Fields are required – this is by design as different positions require different fields.
I have created a Block Template to display the custom fields in my CPT.
All fields are present in my Block Template. I also created Labels for each custom field result, i.e.:
Label 1
Label 1’s associated Custom Field.
Label 2
Label 2’s associated Custom Field.
and so on…
However – Since not all custom fields are required – if they are not filled in – they do not appear.
But the Labels still do – which are manually generated in my block template for each field.
Is there a way to HIDE the labels if there is no custom field information present?
(I could not find a way to pass Custom Field Label through to the front end – which would negate the need for generating labels in the block template.
Thank you!
https://imgur.com/a/JyfPRKt