The Support Forums will be in read-only mode for a scheduled maintenance window on 01 September 2016 14:00 UTC - 20:00 UTC. More information.

Query Multiple Taxonomies
Change relation from "AND" to "OR" (7 posts)

  1. tejas.hapani
    Posted 4 years ago #

    Hi all,

    Is it possible to get the result using "OR" not "AND".
    Actually i want to display the result based on the selected variations. like if user select Color "White" and "Red", then it will result all product having color either "White" or "Red".

    Please help me to get this solution?

    Thanks in advance.


  2. mariusmarius
    Posted 3 years ago #

    I have the same problem, did you find any solution ?
    Thanks !

  3. Jason
    Posted 3 years ago #

    I agree, the "AND" is confusing to everyone I've asked about it right off the bat. It threw me for a sec as well and I usually figure things out very quickly. I saw that, and at the same time the author is about to roast me for editing the github wiki....

  4. wiktoratgmail
    Posted 3 years ago #

    I have solution but is ugly. Just change all "+" to "," in plugin files. After update all changes will gone. It's not good solution but works for me. BTW this plugin is great!

    core.php line 147

    $query[ $taxonomy ] = trim( implode( '+', $value ), '+' );

    to $query[ $taxonomy ] = trim( implode( ',', $value ), ',' );

    line 246
    $value = implode( '+', $value );
    $value = implode( ',', $value );

    walkers.php line 34
    $query[$this->taxonomy] = $query[$this->taxonomy] . "+" . $this->term->slug;
    $query[$this->taxonomy] = $query[$this->taxonomy] . "," . $this->term->slug;
    line 61
    $this->selected_terms = explode( '+', qmt_get_query( $this->taxonomy ) ); to
    $this->selected_terms = explode( ',', qmt_get_query( $this->taxonomy ) );

  5. jlankford
    Posted 3 years ago #

    I have the opposite problem.

    I have this plugin installed, with unmodified code. I'm using it to drill down my categories. I have several parent categories with 2 levels of child subs.

    Testing out this plugin, I selected two child subs that should return no results. Instead, it treated it as an 'or' and included posts from both categories. This of course rings true for any situation.

    Instead of drilling down, I'm just doing a search that turns up way more posts than I'd like.

    Am I missing something?

    Thanks for any help.

  6. Contemplative Computing
    Posted 3 years ago #

    I'm also having the opposite problem. Checkbox search is delivering OR results when I need AND.

  7. exactprecisions
    Posted 3 years ago #

    @contemplative Computing & @jlankford - I'm having the same issue as you all. Not sure exactly what you all are doing but I'm using the plugin without any modifications and I'm having the issue with the widget and also including it by the_widget()

    As seen here


Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Query Multiple Taxonomies
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic