Looking for support? You can access the support system via your account.
- This topic has 17 replies, 2 voices, and was last updated 5 years, 5 months ago by .
The topic ‘Having trouble limiting search by ACF field’ is closed to new replies.
Looking for support? You can access the support system via your account.
Forums › Forums › Search & Filter Pro › Having trouble limiting search by ACF field
So, I have filters happening on a custom taxonomy archive for a custom post type, and it works fine and is pulling in everything without an issue.
Here’s a link to where this is working:
https://www.geoart.com/schematic-categories/onshore/
I’d like to remove the filter for “Licensable” in the right sidebar and just limit the output of this to the things that actually are licensable instead.
The ACF fields which holds that information is called perez_licensable and it’s boolean. I’d like to *only* show the posts for which perez_licensable is true (I don’t want users to even see that there’s even an option to see the ones that for which “perez_licensable” is not true).
On the search form editor, under Post Meta (where it says “Only return results which match specific post meta data.”), I select that custom field, and then there’s a selection for “char,” “numeric,” and a few other options. I’ve tried selecting “char” and setting the value to “true” or selecting “numeric” and setting it to “1” but it doesn’t seem to work properly. (I’ve tried leaving the filter for the same post meta in place, and I’ve also tried removing it).
Can you help me figure out what I’m doing wrong? The main issue I seem to be having (I think) is that the variable is boolean, and there’s no option to use that field as if it’s boolean.
Yes, I think probably all of them do. That archive handles several different content types. I don’t think there are any others of the same CPT using that template.
That is a potential problem, as the different forms will conflict with each other.
Filtering by that post meta works fine in the sidebar. I’d be fine with simply showing the posts where that particular post meta is false and then hiding that filter. Is it possible to set a default value that way?
I should also point out — this is the only case where the archive is a taxonomy term. In all other cases it’s a CPT. I don’t understand why there’s a conflict, but that’s ok.
So, in the form you have licensable with option true and false.
You want to fix this to true only?
The topic ‘Having trouble limiting search by ACF field’ is closed to new replies.
© 2024 Search & Filter Support. All Rights Reserved.
This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.
We also use cookies to store items in your cart as well as allowing your to login on the site.
You can adjust all of your cookie settings by navigating the tabs on the left hand side.
By continuing to use this site, you also agree to our Privacy Policy.
Strictly Necessary Cookie should be enabled at all times so that we can save your preferences for cookie settings.
*Other cookies used for logging in and cart functions will only be used when you use those features and cannot be disabled.
If you disable these cookie, we will not be able to save your preferences. This means that every time you visit this website you will need to enable or disable cookies again.
This website uses Google Analytics to collect anonymous information such as the number of visitors to the site, and the most popular pages.
Keeping this cookie enabled helps us to improve our website.
Please enable Strictly Necessary Cookies first so that we can save your preferences!
More information about our Cookie Policy