title: Wordpress query category name and related posts
body: <p>I am trying to query Wordpress custom posts and categories they are related to.
  Query acts strangely, displays category name and all customs posts, not even related to that category (keeps repeating till all categorie names are displayed.)</p>
  
  <p>Example image : <a href="https://i.stack.imgur.com/udptV.png" rel="nofollow noreferrer">Wordpress custom query display</a></p>
  
  <p>My query code:</p>
  
  <pre><code>&lt;div id="page-content-wrapper"&gt;
      &lt;div class="container-fluid"&gt;
          &lt;div class="lookbook-header"&gt;
              &lt;div class="wrap"&gt;
                  &lt;p class="text-left"&gt;lookbook&lt;/p&gt;
              &lt;/div&gt;
          &lt;/div&gt;
  
          &lt;?php
          $taxonomy = 'lookbook_categories';
  $terms = get_terms($taxonomy);
  
      $args=array(
       'taxonomy' =&gt; 'lookbook_categories'
      'post_type' =&gt; 'lookbook',
      'post_status' =&gt; 'publish',
      'posts_per_page' =&gt; -1,
      'caller_get_posts'=&gt; 1
      );
      $my_query = null;
      $my_query = new WP_Query($args);
          if ( $terms &amp;&amp; !is_wp_error( $terms ) ) :
          foreach ( $terms as $term ) { ?&gt;
              &lt;div class="lookbook-category"&gt;
                  &lt;p class="text-center"&gt;
                      &lt;?php echo $term-&gt;name; ?&gt;
                  &lt;/p&gt;
              &lt;/div&gt;
              &lt;?php
  if( $my_query-&gt;have_posts() ) {
          echo '';
          $count=0; 
  while ($my_query-&gt;have_posts()) : $my_query-&gt;the_post();
  if($count == 3) {?&gt;
                  &lt;div class="row"&gt;
                      &lt;?php }
      ?&gt;
                          &lt;div class="col-xs-12 col-sm-12 col-md-4 col-lg-4 no-padding"&gt;
                              &lt;div class="lookbook-item"&gt;
                                  &lt;div class="hvrbox"&gt;
                                      &lt;?php 
                                      $image = get_field('lookbook_image');
                                      if( !empty($image) ): ?&gt; &lt;img src="&lt;?php echo $image['url']; ?&gt;" alt="news" class="img-responsive" /&gt;
                                          &lt;?php endif; ?&gt;
                                              &lt;div class="hvrbox-layer_top"&gt;
                                                  &lt;div class="hvrbox-text"&gt;
                                                      &lt;div class="separator"&gt;&lt;/div&gt;
                                                      &lt;h3&gt;&lt;?php the_title();?&gt;&lt;/h3&gt;
                                                      &lt;div class="separator"&gt;&lt;/div&gt;
                                                      &lt;p&gt;
                                                          &lt;?php the_field('excerpt');?&gt;
                                                      &lt;/p&gt;
                                                  &lt;/div&gt;
                                              &lt;/div&gt;
  
                                  &lt;/div&gt;
  
                              &lt;/div&gt;
                          &lt;/div&gt;
                          &lt;?php    
     $count++; 
          if($count == 3) echo '&lt;/div&gt;';
          endwhile;
  }
                                        }
                      endif;
  wp_reset_query();
  ?&gt;
  
                  &lt;/div&gt;
      &lt;/div&gt;
  </code></pre>
  
  <p>I would like to display category name + posts related to category (not all posts over and over again)</p>