title: Show related posts based on two custom taxonomies in WordPress - AND relationship issue
body: <p>I have a custom post type &quot;product&quot;, and two custom taxonomies: &quot;productfamily&quot; and &quot;industry&quot;.</p>
  <p>On my single product page, I need to show products that are in the same productfamily and industry.</p>
  <p>Some products might be in a few different industries...and my related products section only needs to match one of the industries of the current post to show up.</p>
  <p>Here's what I have so far...</p>
  <pre><code>$wp_query = new WP_Query(
          array(
              'posts_per_page' =&gt; '4',
              'post_type' =&gt; 'product',
              'tax_query' =&gt; array(
                  'relation' =&gt; 'AND',
                          array(
                              'taxonomy' =&gt; 'productfamily',
                              'field'    =&gt; 'slug',
                              'terms'    =&gt; $prodfam,
                              'operator' =&gt; 'IN'
                          ),
                          array(
                              'taxonomy' =&gt; 'industry',
                              'field'    =&gt; 'term_id',
                              'terms'    =&gt; $prodindustry,
                              'operator' =&gt; 'IN'
                          ),
              ),
              'orderby' =&gt; 'title',
              'order' =&gt; 'ASC',
          )
      );
  </code></pre>
  <p>If I change the &quot;AND&quot; relation to &quot;OR&quot;, it seems to partly work by showing products from the same &quot;productfamily&quot;, but doesn't seem to be taking the &quot;industry&quot; into account at all.</p>
  <p>How can I get this to show related products based off of my two custom taxonomies please? Thanks in advance for your help.</p>