Forums › Forums › Search & Filter Pro › ACF custom fields are shown correctly as filter but aren't filtering the results
Tagged: acf, ajax, custom fields, results, url
- This topic has 23 replies, 2 voices, and was last updated 6 years, 2 months ago by Anonymous.
-
Anonymous(Private) August 17, 2018 at 1:39 pm #185852
the strange thing is the filters names and values of the custom fields (made by the ACF plugin) are shown correctly – including the counting for each value etc (the counting next to each value of custom fields filter will also update correctly when filter by WordPress core category or tag is applied)
and if i try to filter by choosing check box of category or by tag – search and filter pro works perfectly with ajax and the results are updated correctly
but – if i try to filter by choosing check box of one of my custom fields values the results won’t update
(the current results will turn semi transparent for a few seconds as if it’s about to update but then it will yield the same results as if there wasn’t any new filter applied)I’m not sure what am I doing wrong
(I’m sure I chose the right key of the custom fileds – the one without the under score etc)Trevor(Private) August 17, 2018 at 3:12 pm #185870You appear to be editing the Home Page right now. Did you add a filter_next_query shortcode before the Elementor element that shows the results (possibly a Post grid), as detailed here:
https://searchandfilter.com/documentation/3rd-party/elementor/
Makes sure you are not using a different widget (you should be using the Posts widget), as I know there are extra widgets that come with some other plugins, that may not work.
Anonymous(Private) August 17, 2018 at 3:22 pm #185874yes
I added the ‘filter_next_query shortcode’ before the Post grid widget
and i left the home page editing screen so you can ceck it now if you want toside note: since taxonomies do work with S&F without a problem
may be I simply should create custom taxonomies (with plugin like ‘pods’)
instead of custom fields (with plugin like ‘ACF ‘)?Anonymous(Private) August 18, 2018 at 9:05 pm #185929O.K
the strangest thing just happened
i duplicated the search form and the home page and then inserted the new (cloned) search form the the new (cloned) home page and updated the settings accordingly (a.k.a the short codes and search results address etc) and- boom – it works! custom fields as filters also work smoothly!
this is really strange..
but….as long as it is working – my client will be happy so I’m happy too 🙂Anonymous(Private) August 18, 2018 at 9:26 pm #185931update: o.k
may be i”m on to something
if i (in the WordPress settings) change the page with the working custom fields-filters to be the home page and update the settings accordingly (by setting the url of the results to be the home page url etc) than the problem resurface again
meaning – again – only the taxonomies filters are working but custom fields as filters wont work anymore
it seems s&f will fail to update the url when a custom field filter is applied in the home pageso.. for now..I’ll still have to use taxonomies but I really hope, Trevor, that you are reading this (probably only in Monday) and it’s giving you some kind of clue how to keep digging into this problem and solve it, could you do that?
could you investigate why custom fields as filters won’t work in home page (but will work in other pages)?Anonymous(Private) August 18, 2018 at 9:45 pm #185933if it’s any help
when i try a custom field filter and nothing happens – if i open chrome’s developer console i can see the following error massage:
http://www.websitename.com/?sf_data=all&_sfm_customfieldname=chosencustomfieldvalue > Failed to load resource: net::ERR_TOO_MANY_REDIRECTS(of course instead of http://www.websitename.com/ i’m seeing my clients website and ‘customfieldname’ is the name of the custom field filter and ‘chosencustomfieldvalue’ is the chosen value of that filter but because of my client I can’t expose them here)
-
AuthorPosts