Skip Navigation

[Resolved] Custom field filter to select only empty fields

This support ticket is created 7 years, 9 months ago. There's a good chance that you are reading advice that it now obsolete.

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.

Our next available supporter will start replying to tickets in about 2.44 hours from now. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- 12:00 – 17:00 12:00 – 17:00 12:00 – 17:00 12:00 – 17:00 12:00 – 17:00 -
- 18:00 – 21:00 18:00 – 21:00 18:00 – 21:00 18:00 – 21:00 18:00 – 21:00 -

Supporter timezone: Asia/Karachi (GMT+05:00)

Tagged: 

This topic contains 2 replies, has 2 voices.

Last updated by zoeS 7 years, 9 months ago.

Assisted by: Noman.

Author
Posts
#474507
Screen Shot 2017-01-06 at 12.36.02.png

Hi, I have just added a new custom field, "secret" to my post type, "houses", and in all of my views that display houses, I only want to display the ones that are not secret. I can't seem to figure out how to do this using the query filter options available though, since I suppose the ones I'm trying to identify don't actually have any data for the new field, and everything I have tried returns no results.

I have attached a screenshot of what I tried, but I guess the problem is that there is no string on the non-secret houses, even an empty one? I suppose I could run a query to add 0 to all of them except the secret ones, but is there a way to avoid that?

#474713

Noman
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Hi Zoe,

Thank you for reaching out to us. You can do it either using Query Filters or using Conditional Output conditions in your loop.

I have shown this setup using Query Filter in a short video here, please take a look:
hidden link

Please note since we are adding a new custom field, old posts needs to be simply “Updated” once to respect to the values of the filter in order to display correct results.

I hope this will solve your problem. Have a great weekend.
Thank you

#475068

Thanks Noman, you're right the way I had it set up worked fine after all of the posts had been resaved.

This ticket is now closed. If you're a Toolset client and need related help, please open a new support ticket.