Skip Navigation

[Resolved] Query Filter by Empty Image custom field

This thread is resolved. Here is a description of the problem and solution.

Problem:
Query Filter by Empty Image custom field

Solution:
You should try to add the "Query filter" for your custom field and set it to "different from" with a blank.

Relevant Documentation:
=> https://toolset.com/documentation/user-guides/views/filtering-views-by-custom-fields/

This support ticket is created 3 years, 8 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.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10: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/Kolkata (GMT+05:30)

This topic contains 3 replies, has 2 voices.

Last updated by hpJ 3 years, 8 months ago.

Assisted by: Minesh.

Author
Posts
#1971821

hpJ

Tell us what you are trying to do?
Hi, Toolset support is just great. I can normally find answers by doing a Google search for "Toolset".... topic.
But now I am trying to use the Views Query filter to only select posts where the Image fields are NOT Empty.
I have tried using the MySql query "Not like" %jpg (without quotes) and %.%, but neither works.
I have used a work around as suggested in this 5 year old post:
https://toolset.com/forums/topic/how-to-filter-for-empty-image-field/
However I will have thousands of posts that will be selected and then I fear that the work around will collect too many results before filtering them in the view. I would love to be able to filter the results in the query.

Is there any documentation that you are following?
https://toolset.com/forums/topic/how-to-filter-for-empty-image-field/

What is the link to your site?
hidden link

#1972027

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

To query the view to get all posts where custom image field is not empty, what if you try to add a "Query Filter" for your custom field and select not equal to blank.

If you do not know how to do it, if you can share admin access details and problem URL where you added your view would help.

*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.

I have set the next reply to private which means only you and I have access to it.

#1972251

hpJ

Hello Minesh,
Thanks for your reponse. It put me on the right track.
I prepared a View and a Page with the idea that you can test it.
I then used the Query filters settings to "different from" with a blank.
That worked perfectly!

Thank you!

#1972253

hpJ

My issue is resolved now. Thank you!