WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. tejas.hapani
    Member
    Posted 2 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.

    http://wordpress.org/extend/plugins/query-multiple-taxonomies/

  2. mariusmarius
    Member
    Posted 1 year ago #

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

  3. Jason
    Member
    Posted 1 year 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
    Member
    Posted 1 year 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 );
    to
    $value = implode( ',', $value );

    walkers.php line 34
    $query[$this->taxonomy] = $query[$this->taxonomy] . "+" . $this->term->slug;
    to
    $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
    Member
    Posted 1 year 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
    Member
    Posted 1 year ago #

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

  7. exactprecisions
    Member
    Posted 1 year 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

    http://wordpress.org/support/topic/relation-and-not-working

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic