Home › Toolset Professional Support › [Resolved] Hide fields that don’t have an value
Problem:
I've added about 35 custom post fields but only want those that have a value to be shown on the front end. What is the best way to only show post fields that have a value as opposed to those which are left blank? I'm showing real estate and not every property will have the same fields filled in. It's too hard and time consuming to build it out all based around conditional logic.
Solution:
I suggest you try with Views shortcode [wpv-conditional] to check if the custom field is empty, then display the content you needed.
Relevant Documentation:
https://toolset.com/documentation/user-guides/conditional-html-output-in-views/checking-fields-and-other-elements-for-emptynon-empty-values/
This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.
Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.
Sun | Mon | Tue | Wed | Thu | Fri | Sat |
---|---|---|---|---|---|---|
- | 9:00 – 13:00 | 9:00 – 13:00 | 9:00 – 13:00 | 9:00 – 13:00 | 9:00 – 13:00 | - |
- | 14:00 – 18:00 | 14:00 – 18:00 | 14:00 – 18:00 | 14:00 – 18:00 | 14:00 – 18:00 | - |
Supporter timezone: Asia/Hong_Kong (GMT+08:00)
This topic contains 2 replies, has 2 voices.
Last updated by davidM-53 7 years ago.
Assisted by: Luo Yang.
I've added about 35 custom post fields but only want those that have a value to be shown on the front end. What is the best way to only show post fields that have a value as opposed to those which are left blank? I'm showing real estate and not every property will have the same fields filled in. It's too hard and time consuming to build it out all based around conditional logic.
Thank you.
Dear David,
I suggest you try with Views shortcode [wpv-conditional] to check if the custom field is empty, then display the content you needed, see the document:
https://toolset.com/documentation/user-guides/conditional-html-output-in-views/checking-fields-and-other-elements-for-emptynon-empty-values/
Thank you Luo. I was able to figure out how to hide field values. Thank you.