title: How to get all posts in selected taxonimies custom post type?
body: <p>I have a post type called 'faq' and taxonomy called 'type' within my template and a few taxonomy terms created "Design", "Print", "Display" etc.</p>
  
  <p>The idea I am trying to implement is to display only the posts that belong to assigned taxonomies (types) without duplication. Each post may be assigned to multiple taxonomies (types).</p>
  
  <p>My current code works fine as long as the post have got only one taxonomy assigned to it. As soon as I assign more then one taxonomy it shows duplicate posts like this:</p>
  
  <ul>
  <li>Question 6</li>
  <li>Question 5</li>
  <li>Question 1</li>
  <li>Question 1</li>
  </ul>
  
  <p>Here is my current code:</p>
  
  <pre><code>                        &lt;?php
  
                          $post_type = 'faq';
                          $tax = 'type';
                          $faq_types = get_field('types');
  
                          $filtered = array();
  
                          $termargs = array( 'include' =&gt; $faq_types );
                          $tax_terms = get_terms($tax, $termargs);
  
                          if ($tax_terms) {
                            $i = 1;
                            foreach ($tax_terms as $tax_term) {
  
                              $args=array(
                                'post_type' =&gt; $post_type,
                                $tax =&gt; $tax_term-&gt;slug,
                                'post_status' =&gt; 'publish',
                                'posts_per_page' =&gt; -1,
                                'caller_get_posts'=&gt; 1
                              );
  
                              $my_query = null;
                              $my_query = new WP_Query($args);
  
                              if( $my_query-&gt;have_posts() ) {
  
                                while ($my_query-&gt;have_posts()) : $my_query-&gt;the_post(); ?&gt;
  
                                  &lt;div class="accordion-section"&gt;
                                      &lt;a class="accordion-section-title" href="#accordion-&lt;?php echo $i; ?&gt;"&gt;&lt;i class="fa fa-chevron-right"&gt;&lt;/i&gt; &lt;?php the_title(); ?&gt;&lt;/a&gt;
  
                                      &lt;div id="accordion-&lt;?php echo $i; ?&gt;" class="accordion-section-content"&gt;
                                          &lt;?php the_content(); ?&gt;
                                      &lt;/div&gt;
                                  &lt;/div&gt;
  
                                  &lt;?php
                                $i++;    
                                endwhile;
                              }
                              wp_reset_query();
  
                            }
                          }
  
                          ?&gt;
  </code></pre>
  
  <p>I'd really appreciate any help with getting this working the way I need.</p>