Joy
(@joyously)
I don’t think the query variables are very well documented.
What WordPress does is use the variables in the URL to match posts in the database.
Your example URL is asking for posts that are in all three categories, not all posts in any of those categories. So I guess it does what you want.
There are a lot of parameters that you can use in code to make the query look for multiple taxonomies, but those parameters need to be in arrays, so there’s no good way to get that into a URL. https://developer.wordpress.org/reference/classes/wp_query/#category-parameters
If you want to match posts that are in different taxonomies, you can simply put both like myflowersite/?bloom_time=spring&exposure=partial-shade
(I actually have that, so I know it works.)
Hi, Joy!
Suppose the following. I have an store with this categories:
- Autumn Winter 19
- Spring Summer 20
- Men
- Women
All products are well categorized. All products belongs to Men or Women, and all products belongs to one or another season.
If I want to show products that belongs to SS20 and Women, for example, is there another way than writing example.com/product-category/ss20+women?? How would you do it? Is there a way to avoid this kind of urls with plus sign, but show products that belongs to those two categories at the same time?
Thanks in advance!!
Joy
(@joyously)
I don’t think there’s another way. That way is good, if it is what you want to achieve.
Ok! Thank you very much Joy!