Forums › Forums › Search & Filter Pro › Only show posts with multiple taxonomies
Tagged: loop, post, search and filter, taxonomy
- This topic has 5 replies, 2 voices, and was last updated 3 years, 10 months ago by Trevor.
-
Anonymous(Private) January 25, 2021 at 7:25 pm #273934
Hello community!
We use “country” as a hierarchical taxonomy listing the respective countries under each continent (e.g. Europe-germany, Italy etc.).
Now we only want to show posts that have more than one country of Europe.
We are using search and filter pro to show the results.
Do you have any experience with that or any suggestions?
Many thanks!
Anonymous(Private) January 26, 2021 at 3:14 pm #274050Hello Trevor,
I thought of a condition when the query for the posts is done.
Depending on the query, I would count the number of taxonomies in each post and use an if-clause to only show the posts with more than one taxonomy.
What do you think bout this approach?
Trevor(Private) January 26, 2021 at 4:30 pm #274054You could do that, if you have the coding skills. You would need (in general) to use this filter in you child theme functions.php file:
https://searchandfilter.com/documentation/action-filter-reference/#edit-query-arguments
-
AuthorPosts