Forums › Forums › Search & Filter Pro › Issue with filtering by custom taxonomy
- This topic has 9 replies, 2 voices, and was last updated 7 years, 8 months ago by
Trevor.
-
Anonymous(Private) August 1, 2017 at 5:57 pm #124012
I’m not sure why topic was sent while creating, but I will follow up in reply (can not edit my own topic).
So, I have few of custom taxonomies created for that CPT, and one of them is
companies-alphabet
(taxonomy=companies-alphabet&post_type=companies
), it’s purpose is to add possibility to sort companies by alphabetic letters, in short – onsave_post
I’m grabbing first alfanumeric letter from post title, and adding that term for this post, so incompanies-alphabet
I havea
,b
,c
etc terms.With plugin form settings, I added it as a taxonomy radio buttons. The form works by ajax after manual pushing search button.
Now to the issue … when I’m trying to filter only by that alphabet taxonomy, It’s not working. But if I will select some other filtering option and then also a letter, then it works fine. What I noticed in console is some issue with links to which ajax sends requests … here are examples:
Those works fine, with proper results:
/companies-type/public-company/?_sft_companies-alphabet=d
/tech-sector/computer-network-security/?_sft_companies-specialities=big-data&_sft_companies-alphabet=c
And those ones are not working:
/compdnies-[0]lph[0]bet/[0]/
(while the proper one should becompanies-alphabet/d/
ford
letter)
/comptnies-[0]lph[0]bet/[0]/
(t
letter)What I also noticed is that every
a
letter in that link seams to have issues. First iscompanies
in taxonomy name, a letter is changed by the one that was selected to filter with it, and then inalphabet
as second part of taxonomy name, all a are replaced with[0]
.I was trying to checking plugin code to find some string replacing code that is also do some changes with URLs, but with no success.
Anonymous(Private) August 2, 2017 at 9:58 am #124144Hey Trevor, this is native WordPress functionality:
https://codex.wordpress.org/Function_Reference/register_post_type#rewriteTrevor(Private) August 2, 2017 at 6:21 pm #124236Hi
I did check, and Ross has previously confirmed that you cannot do URL rewrites, because we rely on the query strings in our javascript to perform the filter. We are working on a major release, V3, which will allow pretty SEO friendly links, but that is some months away yet.
Anonymous(Private) August 8, 2017 at 10:14 am #124983Hey Trevor, I would accept this answer, if I would have the same problems with other taxonomies assigned to the same CPT. Also only CPT uses rewrite, not taxonomies. I have no issue with filtering for that CPT and other taxonomies, also this particular one for alphabet works if the filtering query contains at least one more condition, but it’s not working alone.
So it has no sense for me, cause most of the form is working with rewrite on CPT.
-
AuthorPosts