Forums › Forums › Search & Filter Pro › Filter by custom field
- This topic has 7 replies, 2 voices, and was last updated 10 years, 8 months ago by
Ross.
-
Anonymous(Private) November 11, 2015 at 12:51 am #29452
I have a custom post type with an ACF field that is a select field containing multiple values. The field shows up in the S&F post meta as a meta key name, and I added the select field’s values as options in the S&F post meta.
The All Items selection in S&F displays all of the posts from my custom post type, but the option values are not filtering the post meta options.
Any ideas?
Ross Moderator(Private) November 11, 2015 at 11:40 pm #29582Hi Sam
Usually you have to choose the field without the underscore – try using the “Auto Suggest” feature on both versions – the one that gives some desired and valid options will be the one you should use.
Also, when you change the meta key, the S&F cache has to be rebuilt – check the status of the cache.
If the cache has not completed building – none of your filters will work.
Let me know how you get on with that and we can take it from there.
Also, I’ve never actually included the “Field Groups” option in any of my ACF testing.
Thanks
Ross Moderator(Private) November 12, 2015 at 2:15 pm #29690Hey Sam
S&F does work with the standard loop in Archive or Post Type Archive results modes.
The thing is, in this case your template might have a custom query somewhere in template itself or in the theme files which overwrites the default loop:
http://www.designsandcode.com/wordpress-plugins/search-filter-pro/faqs/#h-bad-template
You could try to add this largely undocumented action:
<?php do_action("search_filter_archive_query", 749); ?>Just before your
have_posts– which should replace the global $wp_query – replace749with the ID of your search form.Thanks
-
AuthorPosts