Does anybody know if I can do an OR search in the URL like:
(this example actually returns data but only the results for the second filter group (anthropology / china))
Any hints appreciated!
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It only takes a minute to sign up.
Sign up to join this communityDoes anybody know if I can do an OR search in the URL like:
(this example actually returns data but only the results for the second filter group (anthropology / china))
Any hints appreciated!
First (since 4.7.1) you will need to re-activate the filter
parameter.
Then make sure you have REST support activated for your custom post type (books
).
Next you have to allowing the query args meta_query
and parse it.
This answer shows how to do all this. Specifically, how to construct the meta query and the compare
operators. : https://wordpress.stackexchange.com/a/227869/111022
category_name
parameter takes a single string, and doesn't support an array as an argument, even if you get an array out of this WP_Query won't support that, you'll need to pass in IDs instead and usecategory__in