Forums Forums Search & Filter Pro dependent taxonomies

Viewing 4 posts - 1 through 4 (of 4 total)
  • Anonymous
    #253613

    Hello,

    I’m a developer trying to use Search & Filter Pro to handle something WordPress doesn’t offer: dependent (or primary/secondary) taxonomies.

    For example:

    • Taxonomy A
      • Term 1
      • Term 2
      • Term 3
    • Taxonomy B
      • Term 4
      • Term 5
      • Term 6

    Taxonomy B is related to Taxonomy A : Term 2 but is different enough that using a hierarchical structure doesn’t make sense.

    I’ve managed to conditionally hide the form field Taxonomy B using the sf_display_field filter.

    The problem is when a Taxonomy B term is selected and the Taxonomy A term is changed to one without dependents, the dependent term remains in the URL which returns no results.

    For example, using the post type archive option:
    /tax-a/term-2/?_sft_tax_b=5 = works great

    If the user then selects a different primary term:
    /tax-a/term-1/?_sft_tax_b=5 = nothing found

    Any suggestions?

    Thanks,
    Chris

    Trevor
    #253670

    Are you able to send me a live link/URL to your search page so I can take a look?

    Anonymous
    #253700

    Thanks for the quick reply, Trevor.

    Unfortunately, the site is not live yet. I solved my problem by adding some conditional redirects to the init hook which act like rewrite rules.

    I was hoping to apply the logic via filters but the plugin does not seem to offer suitable ones nor does it seem to modify the tax or meta queries, at least as far as I can tell. I started digging into the code but got lost in the cache mechanism. 🙂

    Overall, it’s a good plugin that got me 95% there.

    Cheers,
    Chris

    Trevor
    #253705

    Thanks for letting me know. I will close this thread for now.

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