Forums Forums Search & Filter Pro Only show posts with multiple taxonomies

Viewing 6 posts - 1 through 6 (of 6 total)
  • Anonymous
    #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!

    Trevor
    #273948

    I cannot think of a simple automated way to do this, but you could add a custom field to your posts and manually indicate this, and then add a post meta condition to pre-filter on that basis.

    Anonymous
    #274050

    Hello 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
    #274054

    You 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

    Anonymous
    #274422

    I think your approach is the right one but I still do not get it…

    Could you explain that in more detail?

    Trevor
    #274441

    I have just re-read your question, and I apologize, I think I misunderstood you.

    Reading it again, what you want is not possible, sorry.

Viewing 6 posts - 1 through 6 (of 6 total)